IF Range

dgavin

Active Member
Joined
Feb 16, 2005
Messages
302
Can you help with the following forumula.

If "B" appears in range D18-D39 and any result is less than 5 in B18-B39, then "BACK" if not then ""
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Do you mean any corresponding result is less than 5?
 
Upvote 0
yes but....

Basically I want to return "BACK" if a B is found in range D18-D39, but only if at least ONE of the corresponding D cells is less than 5.

If none of the D cells is less than 5 then the formula should return ""
 
Upvote 0
Can you help with the following forumula.

If "B" appears in range D18-D39 and any result is less than 5 in B18-B39, then "BACK" if not then ""
One way...

=IF(SUMPRODUCT(--(D18:D39="B"),--(B18:B39<5)),"BACK","")
 
Last edited:
Upvote 0
One way...

=IF(SUMPRODUCT(--(D18:D39="B"),--(B18:B39<5)),"BACK","")
If you're using Excel 2007 or later then you can use the more efficient COUNTIFS function.

=IF(COUNTIFS(D18:D39,"B",B18:B39,"<5"),"BACK","")
 
Upvote 0
Here is another way that should work in any version of Excel...

=IF(COUNTIF(B18:B39,"<5")+COUNTIF(D18:D39,"B")>1,"BACK","")
 
Upvote 0
yes but....

Basically I want to return "BACK" if a B is found in range D18-D39, but only if at least ONE of the corresponding D cells is less than 5.

If none of the D cells is less than 5 then the formula should return ""
OK, now I'm confused! :)

Do the conditions have to be on the same row? Like this:

Book1
BCD
2100_A
3100_D
42_B
5300_M
Sheet1

Or, can the conditions be on ANY rows like this:

Book1
BCD
2100_B
3100_D
4100_A
52_M
Sheet1
 
Upvote 0
20 a
15 a
4 b back
9 b back
6 a
18 a
20 b back

Hope you can understand above!

Yes the conditions must be on the same row.

only one cell in column B has dropped below 5 (4) and it has a corresponding "B" in column D, but this is enough for all the "B"'s in column D to give a "BACK" result.
 
Upvote 0
20 a
15 a
4 b back
9 b back
6 a
18 a
20 b back

Hope you can understand above!

Yes the conditions must be on the same row.

only one cell in column B has dropped below 5 (4) and it has a corresponding "B" in column D, but this is enough for all the "B"'s in column D to give a "BACK" result.
Okay, this raises another question. What if one of the "a" rows had dipped below 5... would you want all the "a" rows to be marked "back", or is this always only for "b" rows?
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,706
Members
452,939
Latest member
WCrawford

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