ChristopherBaber
New Member
- Joined
- Jun 11, 2023
- Messages
- 5
- Office Version
- 365
- Platform
- Windows
I'm writing a calculator and one of the inputs could be either a percentage or an amount. I want the cell to format itself based on what it entered. I'm using conditional formatting with a formula that says if cell value >=1, then format as accounting, if cell value <1, then format as a percentage.
I have the cell base format set to General, expecting the conditional formatting to do what I want in the background.
This basically works, but if the existing value is a percentage (40%) and then I enter a value of 30000, it uses the existing % formatting to change this value to 300, then applies the conditional formatting, so it converts the 30,000 to $300 in the cell. it's not just a visual error, it actually removes the 2 zero's.
However, if I enter .4 into the cell, it converts to 40% properly, does NOT change the basic formatting of the cell to percentage, so when I enter 30000 into the cell, it does not remove the 2 zero's and leave the value at $30,000.
It's only when I enter 40% into the cell that it changes the base format to percentage, and then entering a number removes the 2 zero's.
So, I'm looking for a way to force the base formatting to stay as General, or some other way to do what I'm trying to do, that isn't susceptible to this glitch.
I have the cell base format set to General, expecting the conditional formatting to do what I want in the background.
This basically works, but if the existing value is a percentage (40%) and then I enter a value of 30000, it uses the existing % formatting to change this value to 300, then applies the conditional formatting, so it converts the 30,000 to $300 in the cell. it's not just a visual error, it actually removes the 2 zero's.
However, if I enter .4 into the cell, it converts to 40% properly, does NOT change the basic formatting of the cell to percentage, so when I enter 30000 into the cell, it does not remove the 2 zero's and leave the value at $30,000.
It's only when I enter 40% into the cell that it changes the base format to percentage, and then entering a number removes the 2 zero's.
So, I'm looking for a way to force the base formatting to stay as General, or some other way to do what I'm trying to do, that isn't susceptible to this glitch.
Buyer Options.xlsx | |||
---|---|---|---|
M | |||
7 | $400 | ||
Sheet1 |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
M7 | Cell Value | >=1 | text | NO |
M7 | Cell Value | <1 | text | NO |