YTD SUMIF excluding SOME blanks & zeros

kelstar

New Member
Joined
Feb 27, 2011
Messages
11
Hi all, I am trying to do a SUMIF so that YTD for last year matches this year.
So in this example I want the SUM of Jan/Feb 2018 vs SUM of Jan/Feb 2017 to show in my totals at the bottom.
I have a formula that works except it falls apart when I have a zero for a month that should be included (like Jan in this example)
This is what I have
=SUMIF(C14:C25,B14:B25,"<>"&""&0)
So total for 2017 is showing as 1 when it should be 7.
I've tried everything I can think of to fix it! Any help would be appreciated!
Apologies work browser settings won't allow me to copy / paste properly.
The figures for 2018 are B14:B25 and 6 for 2017 is C14:C25 if that helps.

[TABLE="width: 233"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="colspan: 2"]BOOKINGS[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2018[/TD]
[TD]2017[/TD]
[/TR]
[TR]
[TD]JAN[/TD]
[TD]0[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]FEB[/TD]
[TD]4[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MAR[/TD]
[TD]0[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]APR[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]MAY[/TD]
[TD]0[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]JUN[/TD]
[TD]0[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]JUL[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]AUG[/TD]
[TD]0[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]SEP[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]OCT[/TD]
[TD]0[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]NOV[/TD]
[TD]0[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]DEC[/TD]
[TD]0[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]TOTAL[/TD]
[TD]4[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]YTD +/-[/TD]
[TD="colspan: 2"][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
=SUMIF(C14:C25,"<>0",B14:B15)

is the correct syntax for a hard coded condition


Forget what I said before, you want YTD.
 
Last edited:
Upvote 0
This does it:


Excel 2010
ABC
1BOOKINGS
220182017
3JAN06
4FEB41
5MAR01
6APR00
7MAY03
8JUN01
9JUL00
10AUG02
11SEP00
12OCT01
13NOV03
14DEC03
15TOTAL41
167
Sheet6
Cell Formulas
RangeFormula
C16=SUMPRODUCT(--(MONTH($A$3:$A$14&1)<=2)*$C$3:$C$14)


where 2 is the month number
 
Last edited:
Upvote 0
Hi,

Assuming your Column A Months are Text and Not Real Date values, And you want a running YTD as each month passes, modification to Sheetspread's formula:


Book1
ABC
12BOOKINGS
1320182017
14JAN06
15FEB41
16MAR01
17APR00
18MAY03
19JUN01
20JUL00
21AUG02
22SEP00
23OCT01
24NOV03
25DEC03
26TOTAL47
Sheet45
Cell Formulas
RangeFormula
B26=SUMPRODUCT((MONTH($A14:$A25&1)TODAY()))*B14:B25)


B26 formula copied to C26.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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