Sumif Not Equal To

BMil8

Board Regular
Joined
Aug 9, 2010
Messages
153
Office Version
  1. 365
I feel like I'm going crazy. Why does this formula not work? I'm just trying to sum the values in row 2 not equal to the current month. These months are stored as text and are not actual dates.

=SUMIF(B1:J1,"<>"&H1,B2:J2)

I would expect this to equal 17,556 but it returns to full 28,248.

A​
B​
C​
D​
E​
F​
G​
H​
I​
J​
MonthNov-21Nov-21Nov-21Nov-21Dec-21Dec-21Dec-21Dec-21Dec-21
Units134456047236337228204548332400
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
continents.xlsx
ABCDEFGHIJK
1Month21-Nov21-Nov21-Nov21-Nov21-Dec21-Dec21-Dec21-Dec21-Dec
2Units13445604723633722820454833240017556
Sheet9
Cell Formulas
RangeFormula
K2K2=SUMIF(B1:J1,"<>"&H1,B2:J2)
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Your formula works fine for me (and I copied and pasted your data directly to my sheet).
It returns 17556.

Make sure that your ranges are accurate, and then you do not have any extra spaces in your values in row 1.
 
Upvote 0
The formula doesn't work when the headers are text, rather than dates. As (I think) the xxifs functions will convert them.
 
Upvote 0
The formula doesn't work when the headers are text, rather than dates. As (I think) the xxifs functions will convert them.
Is there a something I can add to the formula to help it work as text?
 
Upvote 0
Thanks for updating your profile.
You could use
Excel Formula:
=SUM(FILTER(B2:J2,B1:J1<>H1))
 
Upvote 0
Solution
The formula doesn't work when the headers are text, rather than dates. As (I think) the xxifs functions will convert them.
Ah, interesting...
Yes, I see when I copied it over, it pasted the headers as dates instead of text, which explains why it was working for me.
 
Upvote 0
A SUMPRODUCT formula also appears to work here:
Excel Formula:
=SUMPRODUCT(--(B1:J1<>H1),B2:J2)
 
Upvote 0

Forum statistics

Threads
1,214,938
Messages
6,122,346
Members
449,080
Latest member
Armadillos

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