Using IF Function where logical test is for range

Jazzmann

New Member
Joined
Aug 10, 2009
Messages
16
Greetings, I having issues with a formula the finds a name in a range.

=IF(F10:F600="Bob",SUMPRODUCT((A10:A600="NOT SENT")*B10:B600),"")

I keep getting #value error.

Any help would be appreciated

Thanks
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hi,

I think you mean this, use J1 formula if you don't mind 0 (zero) when there's no match for "Bob" and "Not Sent", if that's an issue, use K1 formula:


Book1
JK
10 
Sheet344
Cell Formulas
RangeFormula
J1=SUMPRODUCT((F10:F600="Bob")*(A10:A600="NOT SENT")*B10:B600)
K1=IFERROR(1/(1/SUMPRODUCT((F10:F600="Bob")*(A10:A600="NOT SENT")*B10:B600)),"")
 
Upvote 0
Thanks jtakw for your response. This might make it a little more understandable. The A10:A600="NOT SENT" should have been <>


<colgroup><col style="mso-width-source:userset;mso-width-alt:987;width:20pt" width="27"> <col style="width:49pt" width="65" span="4"> </colgroup><tbody>
[TD="class: xl69, width: 27"] [/TD]
[TD="class: xl72, width: 65"]A[/TD]
[TD="class: xl72, width: 65"]B[/TD]
[TD="class: xl72, width: 65"]C[/TD]
[TD="class: xl68, width: 65"][/TD]

[TD="class: xl70"]1[/TD]
[TD="class: xl73"]Bob[/TD]
[TD="class: xl73"]Done[/TD]
[TD="class: xl74, align: right"]$25.00[/TD]
[TD="class: xl68"][/TD]

[TD="class: xl70"]2[/TD]
[TD="class: xl73"]Tom[/TD]
[TD="class: xl73"]Sent[/TD]
[TD="class: xl74, align: right"]$15.00[/TD]
[TD="class: xl68"][/TD]

[TD="class: xl70"]3[/TD]
[TD="class: xl73"]Bob[/TD]
[TD="class: xl73"]Won[/TD]
[TD="class: xl74, align: right"]$15.00[/TD]
[TD="class: xl68"][/TD]

[TD="class: xl70"]4[/TD]
[TD="class: xl73"]Kim[/TD]
[TD="class: xl73"]Sent[/TD]
[TD="class: xl74, align: right"]$25.00[/TD]
[TD="class: xl68"][/TD]

[TD="class: xl71"]5[/TD]
[TD="class: xl73"]Jane[/TD]
[TD="class: xl73"]Billed[/TD]
[TD="class: xl74, align: right"]$35.00[/TD]
[TD="class: xl68"][/TD]

[TD="class: xl68, colspan: 3"]If A1:A5 = Bob[/TD]
[TD="class: xl68"][/TD]
[TD="class: xl68"][/TD]

[TD="class: xl68, colspan: 5"]and B1:B5 = Won or Billed[/TD]

[TD="class: xl68, colspan: 3"]then Sum C1:C5[/TD]
[TD="class: xl68"][/TD]
[TD="class: xl68"][/TD]

</tbody>
 
Upvote 0
I having issues with a formula the finds a name in a range.

=IF(F10:F600="Bob",SUMPRODUCT((A10:A600="NOT SENT")*B10:B600),"")

Thanks jtakw for your response. This might make it a little more understandable. The A10:A600="NOT SENT" should have been <>

Well, that's Not how you show it in OP, just change the = to <> , use either E1 or F1 formula

Or, if Only Won or Billed is to be included, use either E2 or F2 formula:


Book1
ABCDEF
1BobDone$25.004040
2TomSent$15.001515
3BobWon$15.00
4BobSent$99.00
5KimSent$25.00
6JaneBilled$35.00
Sheet344
Cell Formulas
RangeFormula
E1=SUMPRODUCT((A1:A6="Bob")*(B1:B6<>"Sent")*C1:C6)
E2=SUMPRODUCT((A1:A6="Bob")*(B1:B6={"Won","Billed"})*C1:C6)
F1=IFERROR(1/(1/SUMPRODUCT((A1:A6="Bob")*(B1:B6<>"Sent")*C1:C6)),"")
F2=IFERROR(1/(1/SUMPRODUCT((A1:A6="Bob")*(B1:B6={"Won","Billed"})*C1:C6)),"")


EDIT: Additional options.
 
Last edited:
Upvote 0
Actually, you don't even need SUMPRODUCT, SUMIFS will work fine (unless your Excel is pre-2007):


Book1
ABCDHI
1BobDone$25.004040
2TomSent$15.001515
3BobWon$15.00
4BobSent$99.00
5KimSent$25.00
6JaneBilled$35.00
Sheet344
Cell Formulas
RangeFormula
H1=SUMIFS(C1:C6,A1:A6,"Bob",B1:B6,"<>Sent")
H2=SUM(SUMIFS(C1:C6,A1:A6,"Bob",B1:B6,{"Won","Billed"}))
I1=IFERROR(1/(1/SUMIFS(C1:C6,A1:A6,"Bob",B1:B6,"<>Sent")),"")
I2=IFERROR(1/(1/SUM(SUMIFS(C1:C6,A1:A6,"Bob",B1:B6,{"Won","Billed"}))),"")
 
Upvote 0
Thanks jtakw, E1 worked great. I'm going to play around with the others to see what I can come up with. Thanks again
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,274
Members
452,628
Latest member
dd2

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