SUMIF / SUMIFS / IF(AND()) -- Help

bsg141

New Member
Joined
Feb 24, 2018
Messages
2
I have a spreadsheet with a few hundred lines of data. From that data, I need to SUM a quantity value from each line that meets a few criteria. The part that is confusing me most is trying to pull the MONTH in 3-digit character form (i.e. FEB) from a Date field (i.e. 2/26/2018) and comparing it to another cell.

ABCDEFGHI
1124B23
2onhandFEBMARAPRMAYJUNJUL
3inventory556556556556556556556
4forecastxxxxx000000

<tbody>
</tbody>

The data from "Data Dump" is mass data on the second tab of my spreadsheet.

When I enter the formula below into D4, the result is always ZERO.
{=SUM(IF(AND(TEXT('Data Dump'!$E:$E,"mmm")=D2,'Data Dump'!$D:$D=$A1),'Data Dump'!$F:$F,0))}

If I try the SUMIFS function, I get a #VALUE ? error.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Welcome to the MrExcel board!

You don't have the syntax quite right but apart from that, if you only have a few hundred rows, I'd suggest it isn't a good idea to force Excel to check all 1 million+ rows for the conditions.

Try this array formula instead
{=SUM(IF(TEXT('Data Dump'!$E$1:$E$1000,"mmm")=D$2,IF('Data Dump'!$D$1:$D$1000=$A$1,'Data Dump'!$F$1:$F$1000,0)))}

If you didn't want to bother with the array formula entry, this should do the same job
=SUMPRODUCT(--(TEXT('Data Dump'!$E$1:$E$1000,"mmm")=D$2),--('Data Dump'!$D$1:$D$1000=$A$1),'Data Dump'!$F$1:$F$1000)
 
Upvote 0
Using SUMIFS is a viable option...

=SUMIFS('Data Dump'!$F:$F,'Data Dump'!$E:$E,">="&(1&D2)+0,'Data Dump'!$E:$E,">="&EOMONTH(1&D2,0),'Data Dump'!$D:$D=$A1)

assuming that FEB of D2 is indeed the string FEB, not something like 2/11/2017.
 
Upvote 0
Using SUMIFS is a viable option...

=SUMIFS('Data Dump'!$F:$F,'Data Dump'!$E:$E,">="&(1&D2)+0,'Data Dump'!$E:$E,">="&EOMONTH(1&D2,0),'Data Dump'!$D:$D=$A1)

assuming that FEB of D2 is indeed the string FEB, not something like 2/11/2017.
.. assuming also that
- you meant < and , where highlighted above
- all dates in column E are current year dates or that the year of interest is also specified in your formula (assuming there is only one year of interest)
 
Upvote 0
Thanks for catching the errors...

=SUMIFS('Data Dump'!$F:$F,'Data Dump'!$E:$E,">="&(1&D2)+0,'Data Dump'!$E:$E,">="&EOMONTH(1&D2,0),'Data Dump'!$D:$D,$A1)
 
Last edited:
Upvote 0
Thanks for catching the errors...

=SUMIFS('Data Dump'!$F:$F,'Data Dump'!$E:$E,">="&(1&D2)+0,'Data Dump'!$E:$E,">="&EOMONTH(1&D2,0),'Data Dump'!$D:$D,$A1)
No problem. You seem to have only corrected one of them though. :)

Should be this?
=SUMIFS('Data Dump'!$F:$F,'Data Dump'!$E:$E,">="&(1&D2)+0,'Data Dump'!$E:$E,"<="&EOMONTH(1&D2,0),'Data Dump'!$D:$D,$A1)

.. and not an error but I think the coercion of the first of the month is superfluous as this seems to work just as well
=SUMIFS('Data Dump'!$F:$F,'Data Dump'!$E:$E,">=1"&D2,'Data Dump'!$E:$E,"<="&EOMONTH(1&D2,0),'Data Dump'!$D:$D,$A1)
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,426
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top