Sumifs or sumproduct not returning correct value

Liz_I3

Well-known Member
Joined
Dec 30, 2002
Messages
647
Office Version
  1. 2016
Platform
  1. Windows
I want to sum accross columns H9 to EC9 if columns H2 to EC2 equals the value in F2 or F3 . F2 and F3 will always be a number. But in my formula I want to concatenate it will the Letter "S".

This formula retruns a 0 ( not correct) =SUMPRODUCT(($H$2:$EC$2=$F$3&"S")*($H$2:$EC$2=$F$2&"S")*($H6:$EC6))

if I leave out one of the conditions =SUMPRODUCT(($H$2:$EC$2=$F$3&"S")*($H6:$EC6)) I get the correct answer for that condition, but I cannot get it to work for both conditions

I have also tried =SUMIFS(H9:EC9,H2:EC2,F2&"S",H2:EC2,F3&"S") which also returns 0

please what am I doing wrong?

Thanks
L
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
The problem is that in those formulas, you are testing for when BOTH conditions match, and since only one or the other condition can match, it is always returning a FALSE statment in one of the two conditions.

Try:

=SUMPRODUCT(--(($H$2:$EC$2=$F$3&"S")+($H$2:$EC$2=$F$2&"S")),$H6:$EC6)
 
Upvote 0
I want to sum accross columns H9 to EC9 if columns H2 to EC2 equals the value in F2 or F3 . F2 and F3 will always be a number. But in my formula I want to concatenate it will the Letter "S".

This formula retruns a 0 ( not correct) =SUMPRODUCT(($H$2:$EC$2=$F$3&"S")*($H$2:$EC$2=$F$2&"S")*($H6:$EC6))

if I leave out one of the conditions =SUMPRODUCT(($H$2:$EC$2=$F$3&"S")*($H6:$EC6)) I get the correct answer for that condition, but I cannot get it to work for both conditions

I have also tried =SUMIFS(H9:EC9,H2:EC2,F2&"S",H2:EC2,F3&"S") which also returns 0

please what am I doing wrong?

Thanks
L
Try it like this...

=SUMPRODUCT(--(ISNUMBER(MATCH(H2:EC2,F2:F3&"S",0))),H9:EC9)
 
Upvote 0
Thanks both formulas worked

I did not realize that the * represented the "and" operator.

Thanks

L
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,866
Members
452,948
Latest member
UsmanAli786

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