Slight change to formula

ExcelRoy

Well-known Member
Joined
Oct 2, 2006
Messages
2,540
Office Version
  1. 365
Platform
  1. Windows
Hi,

Can someone please assist me in changing the following formula to work if the criteria in Z2 is anything other than "SCT"

=IF($Z$2<>"",IFERROR(INDEX(Backorders!$G$2:$G$1000,SMALL(IF($L$2:$L$1000=$Z$2,ROW($L$2:$L$1000)-ROW($L$2)+1),ROWS(AJ$2:AJ2))),""),"")

Many thanks
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
hi admiral,

Column B : Alpha Numeric Job Reference
Col C, D, E, F with Customer details
Col G : Quantity
Col H : Part Number
Col I : Description

Col L : Supplier Code "SCT" or anything else

I would like data for everything as SCT and everything else other than SCT

The SCT data works fine but the non SCT shows nothing

Sorry for the poor explanation

Thanks
 
Upvote 0
Whilst playing around with the formulal I have noticed that whatever you change in the quotations doesn't matter?

Should this be the case?
 
Upvote 0
Just a guess :)

=IF($Z$2<>"SCT",IFERROR(INDEX(Backorders!$G$2:$G$1000,SMALL(IF(AND($L$2:$L$1000=$Z$2,$Z$2<>"SCT"),ROW($L$2:$L$1000)-ROW($L$2)+1),ROWS(AJ$2:AJ2))),""),"")

AND cannot return an array, just a scalar, while the formula needs an array of multiple evaluations...
 
Upvote 0
1. Z2 = SCT

{=IFERROR(INDEX(Backorders!$G$2:$G$1000,SMALL(IF($L$2:$L$1000=$Z$2,ROW($L$2:$L$1000)-ROW($L$2)+1),ROWS(AJ$2:AJ2))),"")}

2. Anything else but Z2 =SCT

{=IFERROR(INDEX(Backorders!$G$2:$G$1000,SMALL(IF(1-($L$2:$L$1000=$Z$2),ROW($L$2:$L$1000)-ROW($L$2)+1),ROWS(AJ$2:AJ2))),"")}
 
Upvote 0
Hi,

I played a bit with the formula and the data, in my opinion the problem is that $L$2:$L$1000=$Z$2 return FALSE so you got nothing
Although $Z$2 is different from "SCT"

Let's say Z2 = "abc" BUT
$L$2:$L$1000 <> "abc" so you got nothing...
 
Upvote 0
Hi,

Can we change Z2 to a range say Z2:Z1000 ?
 
Last edited:
Upvote 0
Hi Aladin,

I think I have been tying myself up in knots somewhat. Apologies for this

I required a list of SCT orders and a list of Non-SCT Orders, I worked out the SCT list and that works great Z2="SCT" but then ...

I was trying to use the same formula for anything other than SCT whilst remaining Z2 as SCT, of course this was returning nothing, somewhat embarrassed I feel at the moment

I am not sure there is a way to use the same formula for non SCT orders (Listed in Column L) instaed of Z2

Sorry for wasting everyones time here but hopefully a solution is possible still?

Sorry once again
 
Upvote 0
Hi Aladin,

I think I have been tying myself up in knots somewhat. Apologies for this

I required a list of SCT orders and a list of Non-SCT Orders, I worked out the SCT list and that works great Z2="SCT" but then ...

I was trying to use the same formula for anything other than SCT whilst remaining Z2 as SCT, of course this was returning nothing, somewhat embarrassed I feel at the moment

I am not sure there is a way to use the same formula for non SCT orders (Listed in Column L) instaed of Z2

Sorry for wasting everyones time here but hopefully a solution is possible still?

Sorry once again

Z2 must house SCT

1. SCT sublist...

{=IFERROR(INDEX(Backorders!$G$2:$G$1000,SMALL(IF($L$2:$L$1000=$Z$2,ROW($L$2:$L$1000)-ROW($L$2)+1),ROWS(AJ$2:AJ2))),"")}

2. Non-SCT sublist...

{=IFERROR(INDEX(Backorders!$G$2:$G$1000,SMALL(IF(1-($L$2:$L$1000=$Z$2),ROW($L$2:$L$1000)-ROW($L$2)+1),ROWS(AJ$2:AJ2))),"")}

 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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