Help with nesting IF statements

mesteptoe

Board Regular
Joined
Aug 22, 2008
Messages
105
I am working on a project calendar, i.e Weeks v. tasks

As a task is started I want to get the cell relevant to that task and that week to show "Y" and turn RED. I am using the following statement in each cell to do that,
=IF(AND(G8>=$E$21,G8<=$F$21),"Y","") where G8 is the current date, E21 is the date the task starts and F21 the finish date for the task. Now this works fine as long as a finish date for the task (F21) has been entered. Once the date (G8) exceeds the task completion date (F21), the cell is left blank as it should be.
But if the task has started, i.e. E21>0, but not completed, i.e. F21=0 the schedule is left completely blank - as expected. But I need to show RED coloured cells to show the task is in progress.
Somehow I need to link another formula to the
=IF(AND(G8>=$E$21,G8<=$F$21),"Y","")
i.e. =IF(AND(G8>=$E$21,$F$21=0),"Y","") such that two sets of criteria are checked out. Is it possible to link the two statements together with an OR statement? If so, how do I do that?

Thanks for your help.

Regards

Graham
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Sorry, I don't understand what you mean by "even past the current date". Where do you want the colouring to stop?
 
Upvote 0
Hi

The colouring cannot continue past the current date because you cannot undertake a task past the current date. You can programme to complete a task at a date in the future but actual progress can only be shgown to the current date. So, if the task has started and is ongoing at the current date then the cell is coloured red. But cells past the current date must be left blank - until such time as they are current.

Graham
 
Upvote 0
Hi

Afraid not. If both E18 and F18 are blank, i.e. a task not even started, all the cells up to the current date are coloured RED. Should I E-mail you the file?
 
Upvote 0
That's the first time you've mentioned that the cell in column E can be blank. Try:

=IF(AND(ISNUMBER($E$21),G8>=$E$21,G8<=MAX($F$21,TODAY())),"Y","")
 
Upvote 0
I think you've done it for me Andrew, although I needed to change MAX to MIN

=IF(AND(ISNUMBER($E$21),G8>=$E$21,G8<=MIN($F$21,TODAY())),"Y","")

Does that sound logical to you?

Thank you very much.

Regards

Graham
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,121
Members
452,381
Latest member
Nova88

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