SumIf vs Match

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,347
Office Version
  1. 365
Platform
  1. Windows
I have a formula that looks down column B to find a match and then adds the values across its row and sums its values by Years.

I have a new requirement that is sort of the same. In the above when it looks down column B it stops there and adds the years. If the value it searches for in B is listed two or more times, it doesnt add all the values. It stops at a Match.

My new situation needs it to add evrytime it finds the match down column B more like a SumIf than a Match formula.

Is this possible, or should I give up trying to alter this formula and find another way to get to my solution. I can find other ways but they are not very efficient. I am creating new tables and them doing a sumif........

Any help or suggestions are appreciated!



=IF(ISERROR(SUMPRODUCT(--(YEAR('Estimated Hrs & ODC'!$F$3:$FA$3)=H$7),INDEX('Estimated Hrs & ODC'!$F$6:$FA$1036,MATCH(CONCATENATE($C$5," ",$B10),'Estimated Hrs & ODC'!$B$6:$B$1036,0),0))),0,SUMPRODUCT(--(YEAR('Estimated Hrs & ODC'!$F$3:$FA$3)=H$7),INDEX('Estimated Hrs & ODC'!$F$6:$FA$1036,MATCH(CONCATENATE($C$5," ",$B10),'Estimated Hrs & ODC'!$B$6:$B$1036,0),0)))
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
I have a formula that looks down column B to find a match and then adds the values across its row and sums its values by Years.

I have a new requirement that is sort of the same. In the above when it looks down column B it stops there and adds the years. If the value it searches for in B is listed two or more times, it doesnt add all the values. It stops at a Match.

My new situation needs it to add evrytime it finds the match down column B more like a SumIf than a Match formula.

Is this possible, or should I give up trying to alter this formula and find another way to get to my solution. I can find other ways but they are not very efficient. I am creating new tables and them doing a sumif........

Any help or suggestions are appreciated!



=IF(ISERROR(SUMPRODUCT(--(YEAR('Estimated Hrs & ODC'!$F$3:$FA$3)=H$7),INDEX('Estimated Hrs & ODC'!$F$6:$FA$1036,MATCH(CONCATENATE($C$5," ",$B10),'Estimated Hrs & ODC'!$B$6:$B$1036,0),0))),0,SUMPRODUCT(--(YEAR('Estimated Hrs & ODC'!$F$3:$FA$3)=H$7),INDEX('Estimated Hrs & ODC'!$F$6:$FA$1036,MATCH(CONCATENATE($C$5," ",$B10),'Estimated Hrs & ODC'!$B$6:$B$1036,0),0)))
Something like this should work. I'm going to use a generic sheet name so it'll be easier to read!

=SUMPRODUCT((Sheet!B6:B1036=C5&" "&B10)*(YEAR(Sheet!F3:FA3)=H7),Sheet!F6:FA1036)
 
Upvote 0

Forum statistics

Threads
1,224,544
Messages
6,179,430
Members
452,915
Latest member
hannnahheileen

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