Conditional Formatting: IF/THEN

Joined
Jan 18, 2024
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I need a cell to show an x if another cell on a different sheet in the same workbook contains any text. If it doesn't contain any text, the other cell should remain blank as well. Something like ="x"IF('All Wolves'!J15="TRUE") ?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Welcome to the Board!

I think you are talking about a Conditional Formula, and not Conditional Formatting.
Conditional Formatting cannot return any values, only formatting (i.e. color, bolding, underlines, etc).

If you want to return an "x" to a cell based on that condition, the formula would look like:
Excel Formula:
=IF('All Wolves'!J15="TRUE","x","")
or
Excel Formula:
=IF('All Wolves'!J15=TRUE,"x","")
depending on whether that "TRUE" is actually entered as a string or a boolean value.
 
Upvote 0
Okay, that worked if the cell 'All Wolves'!J15 actually says true. But it's actually a date. Not a specific date though so I can't just put in that particular date. The date will change but I want the other sheet to still have just the 'x'. Is there a way to do that?

=IF('All Wolves'!J15=DATE,"x","")

What's the second set of quotation marks for? Thanks so much!
 
Upvote 0
The IF function has three arguments:
=IF(condition to check, what to return if condition is true, what to return if condition is false)

The third (last) argument is optional. If you leave it off, and the condition is false, it will return the word "False". Most people do not want to see this.
By using "", we are literally telling it to return an empty string (nothing) if false.

Regarding dates, dates are actually stored in Excel as numbers, specifically the number of days since 1/0/1900.
You can easily see this by entering any valid date in Excel, and then changing the format of that cell to "General" or "Number". You will see the large number that Excel stores the date as.
So dates in Excel really are just numbers with a special date format applied to them.

Since dates really are numbers, you can just check to see if the value is greater than 0, i.e.
Excel Formula:
=IF('All Wolves'!J15>0,"x","")
 
Upvote 0
Solution

Forum statistics

Threads
1,215,339
Messages
6,124,363
Members
449,155
Latest member
ravioli44

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