Best way to handle IF/THEN formula

rck

New Member
Joined
Nov 17, 2011
Messages
33
Good morning,
I am using an IF/THEN statement, but I didn't think it all the way through before I started using it.

=IF(AND(A2>=TODAY(),B2=$O$2), $P$2, IF(AND(A2>=TODAY(),B2=$O$3), $P$3, IF(AND(A2>=TODAY(),B2=$O$4), $P$4, "N/A")))

DateShiftTotal
Staff
Minimum
Staffing
Open
Positions
ScheduledBC (+1)Average
Unscheduled
Projected
Residual
Projected Above/Below
Minimum Staffing
Actual
Unscheduled
Actual
Residual
Actual Above/Below
Minimum Staffing
ShiftOpen
Positions
01/01/2023A5646N/A603471504A0
01/02/2023B5646N/A603471504B1
01/03/2023C5646260345-1482C2


The problem is that the formula is doing exactly what it is being told to do. However, I would also like for the cell to contain historical values. If the value in $O$2 was "0" on 1/1/2023, then keep the one. If the value in $O$2 changes to 3 on 1/4/2023, store "3" for that date, but keep the "0" on 1/1 (don't change 1/1 to "3").

Is there a better way to handle this by only making changes to $O$2:$O$4?

Thank you in advance!
 
Last edited:

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
I’m a bit confused. Seems like your comparing column B and O which contain letters. In your explanation you said if Column O is “0”.
 
Upvote 0
I would also like for the cell to contain historical values.
That is not possible. You would need to have an expanding list that included the date & then refer to that.
 
Upvote 0

Forum statistics

Threads
1,223,705
Messages
6,173,996
Members
452,542
Latest member
Bricklin

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