Posts

Showing posts with the label sumifs

VBA Sumifs to paste result as values

Image
Clash Royale CLAN TAG #URR8PPP VBA Sumifs to paste result as values Would like to know how to code properly a SUMIFS formula and paste the results as value only. Is it also possible to just have the formula loop only on blank cells? I tried running the code and it seems that is pastes the formula for all cells. I've attached a sample code which I only got from other forums for reference. Would really appreciate your help guys! Option Explicit Sub SumGroups() Dim lastCode As Long, lastFiltCode As Long 'Determine Last Row in Column O (Unfiltered Codes) With Worksheets("Database") lastCode = .Range("O" & .Rows.Count).End(xlUp).Row End With With Worksheets("Sheet3") 'Determine last Row in Column A (Filtered Codes) lastFiltCode = .Range("A" & .Rows.Count).End(xlUp).Row .Range("B2:K" & lastFiltCode).Formula = _ "=SUMIFS(Database!$M$2:$M$" & l...

Excel - SUMIFS for multiple columns

Image
Clash Royale CLAN TAG #URR8PPP Excel - SUMIFS for multiple columns I need to sum the values of several columns, if other cells in the same row match a predefined criteria. The working formula for only 3 columns is the following: =SUM(SUMIFS(‘Sheet1'!W:W; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4");SUMIFS(‘Sheet1'!X:X; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4");SUMIFS(‘Sheet1'!Y:Y; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4")) I will need to use the formula for several cells (and sum more than 10 columns per time) and I will need to change the columns manually, so I need the same formula in the following way: =SUMIFS(‘Sheet1'!W:Y; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4") ,but currently this formula leads to a "#VALUE!" error. The reason for that is (I assume) the use of multiple columns " W:Y " Can you suggest a workaround...