IF(AND(OR Formula

Andrew Skibbz

New Member
Joined
Mar 29, 2017
Messages
28
Hi,
I have the following formula:
=IF(AND([@[Received_Date(Final)]]<>””,[@[Received_Date(Final)]]<today(),trim([@[status_name]])<>”Completed”),TODAY()+TIME(7,0,0),[@[Received_Date(Final)]])</today(),trim([@[status_name]])<>

Basically the formula moves a date to today’s date if the status name is not equal to “completed”

I want to change this to move date if not equal to “Completed” or “Cancelled”

Any Help appreciated!

Thanks,
Andrew
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Hey,
You can add a 3rd AND condition after the 2nd one.
=IF(AND([@[Received_Date(Final)]]<>"",[@[Received_Date(Final)]]<>"Completed",[@[Received_Date(Final)]]<>"Cancelled"),TODAY()+TIME(7,0,0),[@[Received_Date(Final)]])
This will give you today's date when the cell is neither blank, "completed" or "cancelled"
 
Upvote 0
How about
=IF(AND([@[Received_Date(Final)]]<>"",[@[Received_Date(Final)]]< today(),or(trim([@[status_name]])<>"Completed",trim([@[status_name]])<>"Cancelled")),TODAY()+TIME(7,0,0),[@[Received_Date(Final)]])
 
Upvote 0
<today(),trim([@[status_name]])< style="color: rgb(85, 85, 85); font-family: Calibri; background-color: rgb(250, 250, 250);">Deleted


</today(),trim([@[status_name]])<>
 
Last edited:
Upvote 0
Try:

=IF(OR([@[Received_Date(Final)]]={"","Completed","Cancelled"}),[@[Received_Date(Final)]],TODAY()+TIME(7,0,0))
 
Upvote 0
Hi,

For some reason the whole formula did not paste - apologies.

=IF(AND([@[Received_Date(Final)]]<>"",[@[Received_Date(Final)]]<TODAY(),TRIM([@[status_name]])<>"Completed"),TODAY()+TIME(7,0,0),[@[Received_Date(Final)]])

What I am trying to do is move the date from 'Recieved date(final)' to todays date, only if the 'status name' is not equal to "Completed" or "Cancelled".

So basically Cancelled or Completed stay at their current date and all the rest move to todays date.

Thanks,

Andrew
 
Upvote 0
'=IF(AND([@[Received_Date(Final)]]<>"",[@[Received_Date(Final)]]<TODAY(),TRIM([@[status_name]])<>"Completed"),TODAY()+TIME(7,0,0),[@[Received_Date(Final)]])'


 
Upvote 0
When posting formulae containing < or > you need to add a space before & after, otherwise the board treats it as HTML code.
Did you see post#3 which has you full formula?
 
Upvote 0
Sorry, its not letting me post the full formula, so I'll type it in:

=IF(AND([A2<>"",A2<TODAY(),TRIM(A3)<>"Completed"),TODAY()+TIME(7,0,0),A2)
 
Upvote 0
TRIM is not showing in my formula

=IF(AND([@[Received_Date(Final)]] < > "",[@[Received_Date(Final)]]<TODAY(),TRIM([@[status_name]]) < > "Completed"),TODAY()+TIME(7,0,0),[@[Received_Date(Final)]])
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,249
Members
452,623
Latest member
Techenthusiast

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