How to ignore blank criteria in a sumproduct?

kenshin_pa

New Member
Joined
May 3, 2017
Messages
2
I am trying to create a formula that will ignore blank cells in the criteria. The first part shows the criteria from row 1 to row 5 which is first name and last name and if they like Star Trek or Star Wars. The 2nd part shows the data starting in row 6.

The Result column is from the formula that we have been working on which is =SUMPRODUCT(--($D$6:$D$20=F3),--((($B$6:$B$20=B3)+(B3="")>0)+(($B$6:$B$20=C3)+(C3="")>0)),--((($C$6:$C$20=D3)+(D3="")>0)+(($C$6:$C$20=E3)+(E3="")>0)),$E$6:$E$20).

Can someone please help me figure out the formula for Should be column?

1/ABCDEFGHI
2First Name 1First Name 2Last Name 1Last Name 2Star Trek or Star Wars ResultShould be
3PeterStar Trek 306.00 45.00
4PeterAndrewSmithStar Trek 123.00 15.00
5AndrewRikerStar Trek 317.00 53.00
6First NameLast NameStar Trek or Star WarsAmount
7PeterSmithStar Trek 5.00
8AndrewSmithStar Trek 10.00
9PeterRikerStar Trek 11.00
10AndrewRikerStar Trek 13.00
11PeterRikerStar Trek 29.00
12AndrewRikerStar Trek 30.00
13AndrewRikerStar Trek 10.00
14AndrewRikerStar Wars 15.00
15AndrewRikerStar Wars 16.00
16AndrewRikerStar Wars 18.00
17PeterRikerStar Wars 34.00
18PeterRikerStar Wars 35.00
19PeterRikerStar Wars 15.00
20PeterRikerStar Wars 20.00

<colgroup><col><col span="2"><col><col><col><col span="3"></colgroup><tbody>
</tbody>
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi
Welcome to the board

Try:

=SUMPRODUCT(--($D$7:$D$20=F3),--((B3="")*(C3="")+($B$7:$B$20=B3)+($B$7:$B$20=C3)>0),--((D3="")*(E3="")+($C$7:$C$20=D3)+($C$7:$C$20=E3)>0),$E$7:$E$20)
 
Upvote 0
pgc01 you are a genius among genuises!!! Your formula worked perfectly! I might have follow up questions but based on initial tests to the real file it works.

Thank you very much!
 
Upvote 0

Forum statistics

Threads
1,216,077
Messages
6,128,674
Members
449,463
Latest member
Jojomen56

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