IF OR in an array with SMALL

garybusey

New Member
Joined
Nov 2, 2012
Messages
3
I'm trying to use an IF OR in an array with a SMALL argument. Essentially, I have a series of data that will say HIGH or HIGH & LOW in a certain row in column G, and then whatever is in column A of this row will be returned by my formula. It worked great returning those with just HIGH by using this formula:

{=IF(ISERROR(INDEX($A$1:$A$1001,SMALL(IF($G$1:$G$1001="HIGH",ROW($A$1:$A$1001)),ROW(1:1)),1)),"",INDEX($A$1:$A$1001,SMALL(IF($G$1:$G$1001="HIGH",ROW($A$1:$A$1001)),ROW(1:1)),1))}


However I'm trying to get it to return what is in A if G is either HIGH or HIGH & LOW. I can't get this working with IF OR and it is driving me mad, have been trying:


{=IF(ISERROR(INDEX($A$1:$A$1001,SMALL(IF(OR($G$1:$G$1001="HIGH",$G$1:$G$1001="HIGH & LOW"),ROW($A$1:$A$1001)),ROW(1:1)),1)),"",INDEX($A$1:$A$1001,SMALL(IF(OR($G$1:$G$1001="HIGH",$G$1:$G$1001="HIGH & LOW"),ROW($A$1:$A$1001)),ROW(1:1)),1))}

But it doesn't work. I have to use arrays and SMALL as I never know what rows will be showing HIGH or HIGH & LOW as it depends on a series of varying parameters.

Any help would be massively appreciated. Thanks!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Welcome to MrExcel.

Try using addition for OR:

=IF(ISERROR(INDEX($A$1:$A$1001,SMALL(IF((($G$1:$G$1001="HIGH")+($G$1:$G$1001="LOW")),ROW($A$1:$A$1001)),ROW(1:1)),1)),"",INDEX($A$1:$A$1001,SMALL(IF((($G$1:$G$1001="HIGH")+($G$1:$G$1001="LOW")),ROW($A$1:$A$1001)),ROW(1:1)),1))
 
Upvote 0
Welcome to MrExcel.

Try using addition for OR:

=IF(ISERROR(INDEX($A$1:$A$1001,SMALL(IF((($G$1:$G$1001="HIGH")+($G$1:$G$1001="LOW")),ROW($A$1:$A$1001)),ROW(1:1)),1)),"",INDEX($A$1:$A$1001,SMALL(IF((($G$1:$G$1001="HIGH")+($G$1:$G$1001="LOW")),ROW($A$1:$A$1001)),ROW(1:1)),1))

Andrew, that works perfectly, thanks a lot, this was driving me mad! Cheers
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

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