SPAM This thread is for random spam!!

Lamp

Gold Star Holder!!
Joined
Jan 16, 2005
Messages
23,001
Need some Excel custom formatting help

How do I apply this rule to all numbers in a column:
IF the cell is zero, OR a whole number (eg 14) THEN no decimal places
ELSE display to 2 decimal places

Example
25.67 should display as 25.67
25.60 should display as 25.60
25.00 should display as 25
0.50 should display as 0.50
0 should display as 0, Not 0.00

Cheers
 

caLLous

I am a FH squatter
FH Subscriber
Joined
Dec 23, 2003
Messages
18,433
Need some Excel custom formatting help

How do I apply this rule to all numbers in a column:
IF the cell is zero, OR a whole number (eg 14) THEN no decimal places
ELSE display to 2 decimal places

Example
25.67 should display as 25.67
25.60 should display as 25.60
25.00 should display as 25
0.50 should display as 0.50
0 should display as 0, Not 0.00

Cheers
It's a bit clunky but you can set up conditional formatting on the first cell with a formula:
Code:
=SEARCH(".0",TEXT(x,"0.0"))
where x is the cell. Then use the format painter to copy it to the rest of the column.

It has to be done on a cell by cell basis, you can't just do the whole column with one format rule.
 

Lamp

Gold Star Holder!!
Joined
Jan 16, 2005
Messages
23,001
Thanks mate
I've got 900 cells :eek7:
Must be a way to format in one go
 

Job

The Carl Pilkington of Freddyshouse
Joined
Dec 22, 2003
Messages
21,652
Did Gisburn forest MTB trakls near Clitheroe yesterday, been before, but only did a small bit.
The new red routes are insane, its like going through a video game, gorgeous moss covered woods, derelict farmhouses, tight valleys along side rivers...it has to be one of the best in the country.
The ride over the rocky top is practically undoable but such a great challange.
They have a black run as well for nutters only with 10ft dropoffs and near vertical 50ft rocky descents.
5hrs non stop riding, even with an electric bike I was destroyed.

Trail Info | Gisburn Bike Trails
 

CorNokZ

Currently a stay at home dad
Joined
Jan 24, 2004
Messages
19,779
Need some Excel custom formatting help

How do I apply this rule to all numbers in a column:
IF the cell is zero, OR a whole number (eg 14) THEN no decimal places
ELSE display to 2 decimal places

Example
25.67 should display as 25.67
25.60 should display as 25.60
25.00 should display as 25
0.50 should display as 0.50
0 should display as 0, Not 0.00

Cheers
Get the power query plugin for Excel. Could handle that in a split second
 

Job

The Carl Pilkington of Freddyshouse
Joined
Dec 22, 2003
Messages
21,652
Theyre filming the new War of the Worlds by us, my mate sneaked onto a quiet part of the set and took this picture.
 

Attachments

  • Screenshot_2018-04-16-09-45-13.png
    Screenshot_2018-04-16-09-45-13.png
    1.8 MB · Views: 27

caLLous

I am a FH squatter
FH Subscriber
Joined
Dec 23, 2003
Messages
18,433
Can't you just use the ROUND function?

Code:
=ROUND(x, 2)
No idea tbh. If you round you'll lose the second dp if the value 2.20 or something, which breaks @Lamp's stupid rules.

The whole idea of have a different number of decimal places depending on the value in the same column in a spreadsheet abhors me but I'm sure @Lamp has his reasons (from a quick google it seems to be a thing in some accounting circles). A fixed number of decimal places justified to the right, thank you very much.

Thanks mate
I've got 900 cells :eek7:
Must be a way to format in one go
You can do it in one go, you just need to put the correct formatting rule on the first cell in the column (as per my previous post) and then you can use the format painter to copy the format to all the cells below it. It will update the cell reference in the format formula for each one.
 
Last edited:

Lamp

Gold Star Holder!!
Joined
Jan 16, 2005
Messages
23,001
... a thing in some accounting circles

Cheers chaps.

My accountant has "requirements" for submitting stuff to him on Excel. I'm seeing him tomorrow. I'm paying YOU. You edit it or I'll bill you for my time.

Yeah that's what I'll say

(No I won't. I'll just shrug and say "meh")
 

Job

The Carl Pilkington of Freddyshouse
Joined
Dec 22, 2003
Messages
21,652
One of the girls we hung out with when I was younger..man she was a stunner, everyine wanted to bang her, but she never seemed to have a boyfriend.
She goes on holiday to America, comes back and starts telling some stories.
She casually says in front of everyone. ' I was dying for some coke, but didnt have any cash so some old guy put it on his dick and I sucked it off for payment'.
The entire room died.
 

fettoken

I am a FH squatter
Joined
Jul 18, 2004
Messages
9,640
One of the girls we hung out with when I was younger..man she was a stunner, everyine wanted to bang her, but she never seemed to have a boyfriend.
She goes on holiday to America, comes back and starts telling some stories.
She casually says in front of everyone. ' I was dying for some coke, but didnt have any cash so some old guy put it on his dick and I sucked it off for payment'.
The entire room died.

She must have done well for herself in life. Wow.
 

Job

The Carl Pilkington of Freddyshouse
Joined
Dec 22, 2003
Messages
21,652
Nicola McCann.
She turned into a total party animal, took me into town one night and we ended up in a Hells Angels bar, there was one guy sat in a fucking throne with two biker chicks at his feet.
He calls me over, pulls me close and says.
'You be good to her , we let her have her pretty boys'.
It was like a freakin movie.
Id love to know where she is now....boots up facebook.
 

fettoken

I am a FH squatter
Joined
Jul 18, 2004
Messages
9,640
Nicola McCann.
She turned into a total party animal, took me into town one night and we ended up in a Hells Angels bar, there was one guy sat in a fucking throne with two biker chicks at his feet.
He calls me over, pulls me close and says.
'You be good to her , we let her have her pretty boys'.
It was like a freakin movie.
Id love to know where she is now....boots up facebook.

The good old days huh. My bet is she's fat and has kids. That would ruin a walk-down-memory-lane wank!
 

BloodOmen

I am a FH squatter
Joined
Jan 27, 2004
Messages
17,966
aW14WvK_700b.jpg
 

caLLous

I am a FH squatter
FH Subscriber
Joined
Dec 23, 2003
Messages
18,433
The one I saw had "yes, I did" as the punchline which was better imo.
 

Job

The Carl Pilkington of Freddyshouse
Joined
Dec 22, 2003
Messages
21,652
It works so much better than the original punchline .
 

Lamp

Gold Star Holder!!
Joined
Jan 16, 2005
Messages
23,001
The little guy's gone to the trouble of putting a wig and dress on. At least invite him in for a brew. Can I squeeze your bag?
 

Users who are viewing this thread

Top Bottom