spycein

Board Regular
Joined
Mar 8, 2014
Messages
135
Office Version
  1. 365
Platform
  1. Windows
Hello everyone,
I have two name range lists as follows
Fruits
Orange
Apple
Banana
Coconut
Apricot

Vegetable
Cucumber
Eggplant
Pumpkin
Squash
Tomato

I am looking for a solution to use the above lists under data validation with if condition.

For example
If i Put date on or before 25/03/2020 in Cell A1 then in Cell B1 only Fruits name should show.
If i Put date on or after 26/03/2020 in Cell A1 then in Cell B1 only Vegetable name should show.

Hope i explained my query properly.
Best Regards,
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
in your data validation list use
=IF($A$1>=DATEVALUE("26/03/2020"), $I$1:$I$100,$J$1:$J$100)
this assumes the lists are in column I and J
I = vegetable List
J Fruits
Adjust these ranges to match your lists

lookup_indirect.xlsx
DEFGHIJ
1
25/26/20
3a1
4b2
5c3
6
7
Sheet1
Cells with Data Validation
CellAllowCriteria
E2List=IF($D$2>DATEVALUE("25/5/2020"), $I$3:$I$5,$J$3:$J$5)
 
Upvote 0
How about
=IF(A1<=DATEVALUE("25/03/2020"),Fruits,Vegetable)
 
Upvote 0
How about
=IF(A1<=DATEVALUE("25/03/2020"),Fruits,Vegetable)
Thank you so much @Fluff..
Works like a charm.
Just wanted check if we can incorporate another if condition in the same formula, like if A1=blank then B1 = Blank
Many Thanks.
Best Regards,
 
Upvote 0
in your data validation list use
=IF($A$1>=DATEVALUE("26/03/2020"), $I$1:$I$100,$J$1:$J$100)
this assumes the lists are in column I and J
I = vegetable List
J Fruits
Adjust these ranges to match your lists

lookup_indirect.xlsx
DEFGHIJ
1
25/26/20
3a1
4b2
5c3
6
7
Sheet1
Cells with Data Validation
CellAllowCriteria
E2List=IF($D$2>DATEVALUE("25/5/2020"), $I$3:$I$5,$J$3:$J$5)
Thank you so much for your help.
Best Regards,
 
Upvote 0
How about
=IF(A1="","",IF(A1<=DATEVALUE("25/03/2020"),Fruits,Vegetable))
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,241
Messages
6,123,824
Members
449,127
Latest member
Cyko

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