If statement - simpler?

psrs0810

Well-known Member
Joined
Apr 14, 2009
Messages
1,109
Is there a simpler way of writing this IF statement?

=IF(MONTH(B3)=7,11,IF(MONTH(B3)=8,10,IF(MONTH(B3)=9,9,IF(MONTH(B3)=10,8,IF(MONTH(B3)=11,7,IF(MONTH(B3)=12,6,IF(MONTH(B3)=1,5,IF(MONTH(B3)=2,4,IF(MONTH(B3)=3,3,IF(MONTH(B3)=4,2,IF(MONTH(B3)=5,1)))))))))))


Thank you!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Here's a starter for 10, although I'm sure it could be improved on...

=12-CHOOSE(MONTH(B3),7,8,9,10,11,12,1,2,3,4,5)
 
Upvote 0
I dont think lookup will like that array will it mike?
Oops, LOOKUP would want {1,2,3...,12} as an argument.
CHOOSE, similar to Nimjack's solution, would be better than LOOKUP for discreete situations

=CHOOSE(MONTH(B3),5, 4, 3, 2, 1, 0, 11, 10, 9, 8, 7, 6)
 
Upvote 0

Forum statistics

Threads
1,215,744
Messages
6,126,623
Members
449,322
Latest member
Ricardo Souza

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