Combine conditional sections and conditional values in custom formats?

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,687
Office Version
  1. 365
Platform
  1. Windows
I can have different formats for positive, negative, and zero values: +0;-0;=0.

And I can have different formats up to two conditional value ranges: [<1]0.00;[<10]0.0;#,##0.

Is there any way to combine the two so that I can both the +/-/= prefix and the variable number of decimal places?

I would like the numbers in the left column formatted as shown in the right column:

[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD="align: right"]-23.45[/TD]
[TD="align: right"]-23[/TD]
[/TR]
[TR]
[TD="align: right"]37.52[/TD]
[TD="align: right"]+38[/TD]
[/TR]
[TR]
[TD="align: right"]7.83[/TD]
[TD="align: right"]+7.8[/TD]
[/TR]
[TR]
[TD="align: right"]-1.28[/TD]
[TD="align: right"]-1.3[/TD]
[/TR]
[TR]
[TD="align: right"]0.737[/TD]
[TD="align: right"]+0.74[/TD]
[/TR]
[TR]
[TD="align: right"]-0.482[/TD]
[TD="align: right"]-0.48[/TD]
[/TR]
[TR]
[TD="align: right"]0[/TD]
[TD="align: right"]=0[/TD]
[/TR]
</tbody>[/TABLE]

Can this be done?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Try applying these three:

Custom format: +0;-0;=0
Conditional formatting: rule =AND(A1>-10,A1<10), number format +0.0;-0.0;=0
Conditional formatting: rule =AND(A1>-1,A1<1), number format +0.00;-0.00;=0
 
Upvote 0
Try applying these three:

Custom format: +0;-0;=0
Conditional formatting: rule =AND(A1>-10,A1<10), number format +0.0;-0.0;=0
Conditional formatting: rule =AND(A1>-1,A1<1), number format +0.00;-0.00;=0

Thanks. Clever solution, as usual. I take it that, as I feared, there is no way to do this using only a custom format, right? I have never been able to control the conditional formats. I always end up with dozens, if not hundreds, of rules as I inevitably move rows and columns around. :banghead:
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,318
Members
452,634
Latest member
cpostell

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