AND Function in Dynamic List

drewberts

Board Regular
Joined
Sep 5, 2013
Messages
177
Office Version
  1. 365
Platform
  1. Windows
I'm trying to create 2 x dynamic lists to display items based on no of days to an expiry date. First list shows items which have no. of days to expiry of 0 or less using the following array formula (this works fine):-

{=IFERROR(INDEX($B$1:$B$100,SMALL(IF(R$E$2:$E$100<=0,ROW($E$2:$E$100)),ROW(1:1))),"")}

The 2nd list is to show items which have less than 30 days to go (excluding expired items) - so the criteria is <=30 AND >0 so I've used an AND function as below and I'm just getting the first item in the list - I'm guessing my syntax is wrong somewhere even though its not returning an error.

{=IFERROR(INDEX($B$1:$B$100,SMALL(IF(AND($E$2:$E$100<=30,$E$2:$E$100>0),ROW($E$2:$E$100)),ROW(1:1))),"")}

Col B = Item Name
Col E = Days to Expiry

Can anyone see where I'm going wrong? (Excel 365)
 
Glad we could help & thanks for the feedback.
Apologies - I must be having a bad day (not really used the FILTER function before).

I can see that for each item that meets the criteria it is added to the list below the previous one without having to copy the formula down. The problem is I only want a maximum of 7 items in the FILTER list (even if there is more) as on my sheet there are other things going on in the cells "beneath" the list which would be overwritten - can you limit the FILTER function to a set number of items?
 
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Yup, that can be done like
Excel Formula:
=TAKE(FILTER(B2:B100,(E2:E100<=30)*(E2:E100>0)),7)
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,916
Members
449,093
Latest member
dbomb1414

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