Conditional formatting

smcelv

Board Regular
Joined
Jul 26, 2011
Messages
59
I'm trying to have data in cell A3 supply formatting to cell D3 if a true value is returned.

BUT cell A3's data has 13 characters I need the first 9 characters only to be read.
For example it could read C21167854-002
I need to ignore the 002 as those numbers are prone to change but the C21167854 is relatively constant.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
I am not sure what role Conditional Formatting plays in this.
It sounds like you might just really need the LEFT function, i.e.
Excel Formula:
=LEFT(A3,9)
 
Upvote 0
Is this what you're looking for?

Book1
ABCDE
1
2
3C21167854-002D3true
4
Sheet1
Cell Formulas
RangeFormula
E3E3=IF(LEFT(A3,9)="C21167854","true","false")

1706648324432.png
 
Upvote 0
Is this what you're looking for?

Book1
ABCDE
1
2
3C21167854-002D3true
4
Sheet1
Cell Formulas
RangeFormula
E3E3=IF(LEFT(A3,9)="C21167854","true","false")

View attachment 105997
Ah, maybe that is what they are trying to do. It is not quite clear from the question.

By the way, you usually do not need use IF functions in Conditional Formatting formulas. Just create a boolean expression to return TRUE or FALSE.
For example, you could simply your formula to just:
Excel Formula:
=LEFT(A3,9)="C21167854"
 
Upvote 0
@Joe4 Thanks, I thought of that after I posted. The formula can just go straight into conditional formatting, rather than column "E", too, but I wasn't sure what the OP was trying to compare to, so I did it this way.
 
Upvote 0
Is this what you're looking for?

Book1
ABCDE
1
2
3C21167854-002D3true
4
Sheet1
Cell Formulas
RangeFormula
E3E3=IF(LEFT(A3,9)="C21167854","true","false")

View attachment 105997
Joe that looks exactly what I need. Can't check it just now but pretty sure that's the answer. Thank you very
much for your help!
Is this what you're looking for?

Book1
ABCDE
1
2
3C21167854-002D3true
4
Sheet1
Cell Formulas
RangeFormula
E3E3=IF(LEFT(A3,9)="C21167854","true","false")

View attachment 105997
Joe that looks exactly what I need. Can't check it just now but pretty sure that's the answer. Thank you very

much for your help!
Is this what you're looking for?

Book1
ABCDE
1
2
3C21167854-002D3true
4
Sheet1
Cell Formulas
RangeFormula
E3E3=IF(LEFT(A3,9)="C21167854","true","false")

View attachment 105997
 
Upvote 0
Joe that looks exactly what I need. Can't check it just now but pretty sure that's the answer. Thank you very
much for your help!

Joe that looks exactly what I need. Can't check it just now but pretty sure that's the answer. Thank you very

much for your help!
Sorry Jen - Thank you for your help.
 
Upvote 0
Thanks for the feedback, I'm glad to help. As @Joe4 said, you can simplify the formula to:
Excel Formula:
=LEFT(A3,9)="C21167854"
 
Upvote 0
You are welcome.
Glad that we were able to help!
 
Upvote 0

Forum statistics

Threads
1,215,096
Messages
6,123,074
Members
449,093
Latest member
ripvw

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