Formatting Cell Based on content using Conditional Formatting

itsrich

New Member
Joined
Apr 13, 2009
Messages
49
Office Version
  1. 2019
Platform
  1. Windows
I want the cell containing the following formula to change the fill color when the formula results in a date. =IF(ISBLANK(INDEX('Where is production'!$G:$N,MATCH('The Time Line CURRENT'!D3,'Where is production'!$D:$D,0),5)),"",INDEX('Where is production'!$G:$N,MATCH('The Time Line CURRENT'!D3,'Where is production'!$D:$D,0),5))

The result of the formula is text or number

Currently, I am attempting to use conditional formatting to format the cell, but the text and numbers are formatted the same. I can figure out how to determine the difference between a number and text.

TY for your help
 
i thought futher from my previous post to show an example of things out of sync

Book2
B
1
244958
3x
444960
5x
644962
7x
844964
9x
1044966
11x
1244968
13x
1444970
15x
1644972
Sheet2
Cell Formulas
RangeFormula
B2,B16,B14,B12,B8:B10,B6,B4B2=A2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B1:B16Expression=ISNUMBER(B2)textYES


here i have selected $B$1:$B$16
but the formula is =Isnumber(B2)

so the conditional format - looks at B1 as thats the start of the selection -
then it uses the formula and checks if its a number- BUT the formula says look at B2
B2 is a number , so thats TRUE , and hightlight the cell - but as its looking at B1 it highlights B1 - wrong cell
then
it moves down the Selection, and looks at B2 to highlight - and formula now checks B3, so tests B3 is false - so does not highlight B2
then
it moves down the Selection, and looks at B3 to highlight - and formula now checks B4, so tests B4 is TRUE - so does not highlight B3

hence all the conditional formatting is 1 row out
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
OK, solved it. Simplified conditional formatting. @etaf gave a good explanation of how conditional formatting works. TYVM

I left the =ISTEXT(A2) conditional formatting off because some cells that appear blank, changed color as if they were text. I also changed my mind about the need for these to be a contrasting color.

End result, @etaf helped me solve the problem. I modified the formula to =AND(ISNUMBER(M3),M3<>"",M3>0), using the knowledge shared by @esaf. Successful outcome!

2023.02.14 FAB Tracking & Reporting Sheet.xlsx
M
2318-Jan
2418-Jan
255-Dec
2616-Dec
27X
2818-Jan
2916-Dec
3016-Dec
3118-Jan
3218-Jan
3330-Jan
3430-Jan
3524-Jan
3619-Jan
3718-Jan
3819-Jan
3919-Jan
40WIP
41WIP
4218-Jan
4318-Jan
44WIP
45WIP
4625-Jan
4725-Jan
The Time Line CURRENT
Cell Formulas
RangeFormula
M23:M47M23=IF(ISBLANK(INDEX('Where is production'!$G:$N,MATCH('The Time Line CURRENT'!D23,'Where is production'!$D:$D,0),5)),"",INDEX('Where is production'!$G:$N,MATCH('The Time Line CURRENT'!D23,'Where is production'!$D:$D,0),5))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
M3:M304Expression=AND(ISNUMBER(M3),M3<>"",M3>0)textNO
 
Upvote 0
i'm glad you have it sorted out now and getting the results you want
very welcome
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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