Formula nested IF OR every 12th number return BLUE

rplohocky

Active Member
Joined
Sep 25, 2005
Messages
292
Office Version
  1. 365
Platform
  1. Windows
Hello,
I am looking for a shorter more efficient way to write a formula. I would like to have the formula look in a cell and return a word based on what number is in the cell. I know how to achieve this but I am looking to see if there is a shorter method than what I have here:
=IF(OR(D3=1,D3=13,D3=25,D3=37,D3=49,D3=61,D3=73,D3=84,D3=97,D3=109,D3=121,D3=133,D3=145,D3=157,D3=169,D3=181,D3=193,D3=205,D3=217,D3=229,D3=241,D3=253,D3=265,D3=277),"BLUE","")
I need to add another 11 statements to this formula so it will be very large. The next IF(OR( would be D3=2,D3=14,D3=26 and the next would be IF(OR(D3=3,D3=15,D3=27. As you see each statement moves to the next number and then the next 12 all the way up to the highest number of 288.
 
Ok i tried that and it doesn't quite have the same results as yours. It seems to go to the next color in line. All I did was change the color name.
Rich (BB code):
=CHOOSE(MOD(D3,12)+1,"BLUE","ORANGE","GREEN","BROWN","SLATE","WHITE","RED","BLACK","YELLOW","VIOLET","ROSE","AQUA")
 

Attachments

  • formula.JPG
    formula.JPG
    25.2 KB · Views: 7
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Which colour should it be if D3 is 12?
 
Upvote 0
The cell colors should match the name in the cells so D3 should be BLUE.
 
Upvote 0
In that case Blue should be the second colour in the list, with the colour for 12 as the 1st, the same as I showed it.
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

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