SOLVED

if then formula

Copper Contributor

If cell = value, then cells with dates return text.

7 Replies

@Michelle_King 

I'm afraid that's not specific enough. Could you explain in detail what you want to do?

@Hans Vogelaar 

I am wanting to set up a conditional format that if cell A1 says "yes" then the selected cells that contain a date will replace the date with an "x".  However if cell A1 says "no", then nothing is changed in the selected cells.

best response confirmed by Michelle_King (Copper Contributor)
Solution

@Michelle_King 

Thank you.

Select the cells that you want to format.

On the Home tab of the ribbon, click Conditional Formatting > New Rule...
Select 'Use a formula to determine which cells to format'.
Enter the formula

=$A$1="yes"

Click Format...
Activate the Number tab.
Select Custom in the Category list.

Enter "x" (including the quotes!) in the Type box.
Click OK, then click OK again.

Thank you! That worked perfectly.
I would like for this formula to return a 0 if the result is a minus number.

=DAYS(B119,TODAY())

@Cliff Deane 

It would have been better to ask your question in a new discussion, since it has nothing to do with this one.

 

=MAX(DAYS(B119,TODAY()),0)

@Hans Vogelaar 

Sorry, my first time.  Thanks for the help.

 

1 best response

Accepted Solutions
best response confirmed by Michelle_King (Copper Contributor)
Solution

@Michelle_King 

Thank you.

Select the cells that you want to format.

On the Home tab of the ribbon, click Conditional Formatting > New Rule...
Select 'Use a formula to determine which cells to format'.
Enter the formula

=$A$1="yes"

Click Format...
Activate the Number tab.
Select Custom in the Category list.

Enter "x" (including the quotes!) in the Type box.
Click OK, then click OK again.

View solution in original post