Format a Table Cell based on another cell value, without VBA

Nicha

New Member
Joined
Feb 10, 2023
Messages
48
Office Version
  1. 2016
Platform
  1. Windows
Hi Excel community!

I have a table where I would like to be able to format the value of the [Process] column according to the value of the [Type_Cli] column, as shown below:

Case [Type_Cli] is 'F' -> Format shoult be : "P000000000"; Star with Letter 'P', followed by nine digits'
Case [Type_Cli] is 'J' -> Format shoult be : "J000000000"; Star with Letter 'P', followed by nine digits'

Example values:

If [Type_Cli] is equal to 'F'-> and user type the number 12345, The cell must show : P000012345
If [Type_Cli] is equal to 'J'-> and user type the number 2345, The cell must show : J000002345

Process [Format]Process - ValueTipo_Cli
J000000000J000002345J
P000000000P000012345F
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
use a conditional formatting rule
use custom formatting
P000000000
with 2 rules - 1 for J and 1 for F

Book2
ABC
1process formatvaluetipo
2J000000123J
3P000000012f
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B3Expression=C2="F"textYES
B2:B3Expression=C2="J"textYES
 

Attachments

  • Screenshot 2024-04-05 at 11.47.06.jpeg
    Screenshot 2024-04-05 at 11.47.06.jpeg
    50.8 KB · Views: 11
Upvote 0
Hi @etaf, Thank you. With your solution, when I insert a numeric value in column B, this will automatically format that cell as pretended?
Forgive me please; I didn't fully understand witch are the best method.
Can you explain step by step?

Thank you once more.

P.s: I forgot to mention, but if Column [C] has no value, Column must show nothing.
Byst regards.
 
Upvote 0
i tried to show the screen shot for setting up
however
for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
Conditional Formatting

Highlight applicable range >>
B2:B100 - Change, reduce or extend the rows to meet your data range of rows

Home Tab >> Styles >> Conditional Formatting
New Rule >> Use a formula to determine which cells to format
Edit the Rule Description: Format values where this formula is true:
=C2="F"

Format [Number, Font, Border, Fill]
use custom formatting -->> Number and use
P000000000
choose the format you would like to apply when the condition is true
OK >> OK

i then setup another rule for C2="J"
and used
use custom formatting -->> Number and use
J000000000
if cell in B is blank then you get a blank

Book2
ABC
1process formatvaluetipo
2J
3P000054321f
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B3Expression=C2="F"textYES
B2:B3Expression=C2="J"textYES
 
Upvote 0
i tried to show the screen shot for setting up
however
for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
Conditional Formatting

Highlight applicable range >>
B2:B100 - Change, reduce or extend the rows to meet your data range of rows

Home Tab >> Styles >> Conditional Formatting
New Rule >> Use a formula to determine which cells to format
Edit the Rule Description: Format values where this formula is true:
=C2="F"

Format [Number, Font, Border, Fill]

choose the format you would like to apply when the condition is true
OK >> OK

i then setup another rule for C2="J"
and used

if cell in B is blank then you get a blank

Book2
ABC
1process formatvaluetipo
2J
3P000054321f
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B3Expression=C2="F"textYES
B2:B3Expression=C2="J"textYES
Perfect.
Manny Thank's
 
Upvote 0
you are welcome, glad it worked ok for you
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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