Validation List - Multiple IFs - Formula to big

ffialho

New Member
Joined
Apr 27, 2012
Messages
16
I´m working on a formula for a validation list. What I´m doing is:

User chooses the month: May ( for example - the drop down has all 12 months )
Once the month is choosen - there is a second drop down list with the days of that specific month.

I´ve named range all the months

My problem:

The formula below is too big for the validation list formula: J2 is the field where the month is choosen. Is there a way a can reduce to use on the validation list formula or transform it into a macro?!

=IF($J$2=$Y$2;INDIRECT($Y$2);IF($J$2=$Z$2;INDIRECT($Z$2);IF($J$2=$AA$2;INDIRECT($AA$2);IF($J$2=$AB$2;INDIRECT($AB$2);IF($J$2=$AC$2;INDIRECT($J$2);IF($J$2=$AD$2;INDIRECT($J$2);IF($J$2=$AE$2;INDIRECT($J$2);IF($J$2=$AF$2;INDIRECT($J$2);IF($J$2=$AG$2;INDIRECT($J$2);IF($J$2=$AH$2;INDIRECT($J$2);IF($J$2=$AI$2;INDIRECT($J$2);IF($J$2=$AJ$2;INDIRECT($J$2);$IV$4))))))))))))

any help would be gratefull.

thanks
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
See if you can use this....

With this setup you only need Named Ranges 1 for the Months and 1 for the Days.

And the Key to convert the Month Name to Number

Named Range - Months
Named Range Cells C2:C32 - Days
Months
Month #
Days - Drag this formula Down to Row 32
Cell J2
Other Cell for Days Range
January
1
=IF(MONTH(DATE(YEAR(TODAY()),VLOOKUP($J$2,$A$2:$B$13,2,FALSE),ROWS($A$1:$A1)))=VLOOKUP($J$2,$A$2:$B$13,2,FALSE),DATE(YEAR(TODAY()),VLOOKUP($J$2,$A$2:$B$13,2,FALSE),ROWS($A$1:$A1)),"")
Data Validation - List Months
Data Validation - List Days
February
2
March
3
April
4
May
5
June
6
July
7
August
8
September
9
October
10
November
11
December
12

<TBODY>
</TBODY>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,579
Messages
6,120,365
Members
448,956
Latest member
Adamsxl

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