IF Function

JoeG2124

New Member
Joined
Sep 1, 2017
Messages
8
I am not a beginner, but certainly not an expert so maybe someone can help me.

Right now, I have the below Formula in column S and it is working like it is supposed to. In column S, it will populate the word "Red" "Amber" or "Green" based on the difference between the 2 dates in column H&I. Then using conditional formatting that will light up the cell (H2) Red, Amber or Green (S2 = "Green" then H2 lights up Green and so on). I have it now so that if nothing is in column I, then column S stays blank (the "" at the end of the function).

IF(I2|IF(H2|
IF(I2-H2<=13| "Red"|
IF(I2-H2<=27| "Amber"|
"Green"))|
IF(TODAY()-I2<=-28| "Green"|
IF(TODAY()-I2<=-14| "Amber"|
"Red")))|"")

Now I need to include a line for if someone puts the word "Remote" in column H, it needs to return "Green" in column S. The way I have it now CAN work, but that would mean having 2 different formulas and I want to make it so all the cells in Column S all have the same formula. With that first line added, I had to take away the "" that made column S stay blank if nothing was in column I. But I need column S to stay blank when nothing is in column I. After unsuccessfully trying to figure it out for a while, I came here.

IF(H2="Remote"|"Green"|
IF(I2|IF(H2|
IF(I2-H2<=13|"Red"|
IF(I2-H2<=27|"Amber"|
"Green")))|
IF(TODAY()-I2<=-28|"Green"|
IF(TODAY()-I2<=-14|"Amber"|
"Red"))))
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Interesting that you have your Region settings to have Pipe (|) instead of comma.

Will this work?
Code:
=IF(I2|IF(H2="Remote"|"Green"|IF(H2|IF(I2-H2<=13| "Red"|IF(I2-H2<=27| "Amber"|"Green"))|IF(TODAY()-I2<=-28| "Green"|IF(TODAY()-I2<=-14| "Amber"|"Red"))))|"")
 
Upvote 0
Thank You @GR00007... that work perfectly. Sorry about the delay in responding, I just got back to this.

I use the pipe in my formulas because that is how the person at my work did it and they were the one that "trained" me. They were better at Excel than me, so I figured I would just copy them. They have abandoned me and left me with spreadsheets that I need to keep updated.
 
Upvote 0

Forum statistics

Threads
1,224,821
Messages
6,181,163
Members
453,021
Latest member
Justyna P

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