Help. .xlsx gurus....
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

[Closed] Help. .xlsx gurus. Round up to nearest £0.05?

20 Posts
12 Users
0 Reactions
94 Views
 benz
Posts: 1143
Free Member
Topic starter
 

So I have selling price calculations but want to always round up to nearest £0.05.

How can I do this?

Thanks.


 
Posted : 09/03/2016 9:21 pm
Posts: 91000
Free Member
 

Round *up* or round to nearest?


 
Posted : 09/03/2016 9:26 pm
Posts: 10761
Full Member
 

Floor (a1+0.04,0.05) or similar


 
Posted : 09/03/2016 9:27 pm
Posts: 91000
Free Member
 

EDITED

=(C5*100) + (5 - MOD(C5*100, 5)) / 100

Works except £0.20 gives £0.25...


 
Posted : 09/03/2016 9:29 pm
Posts: 0
Free Member
 

=round( value * 100 / 5,0) /100 * 5

or simplified

=round( value * 20,0) / 20

edit: soz, doesn't always round up, didn't read that 🙂


 
Posted : 09/03/2016 9:31 pm
Posts: 91000
Free Member
 

CEILING (again in Libre Office)

= CEILING (C5, 0.05)

Couldn't resist a crack myself though.


 
Posted : 09/03/2016 9:36 pm
Posts: 3351
Full Member
 

Allthepies, you can simply yours further with MROUND

=MROUND([b]value[/b], 0.05) is to the nearest multiple of 0.05


 
Posted : 09/03/2016 10:46 pm
Posts: 3351
Full Member
 

=if(MROUND(value,0.05)<value,MROUND(value+0.05,0.05),MROUND(value,0.05))

Maybe?? Quite tired....


 
Posted : 09/03/2016 10:54 pm
Posts: 6257
Full Member
 

=INT(A1)+(0.05*IF(((A1-INT(A1))*20)-INT(((A1-INT(A1))*20))>0,INT(((A1-INT(A1))*20))+1,INT(((A1-INT(A1))*20))))

It's messy, and I may have gone OTT on the parentheses, but it gets the job done.


 
Posted : 09/03/2016 11:02 pm
Posts: 91000
Free Member
 

[b]CEILING FUNCTION[/b]

https://support.office.com/en-us/article/CEILING-function-0a5cd7c8-0720-4f0a-bd2c-c943e510899f

Does what you need, no maybes or complexity.


 
Posted : 09/03/2016 11:10 pm
Posts: 3351
Full Member
 

I'd assumed CEILING was Libre Office only. It's very unlike MS to have the exact function one requires 🙂

If the spreadsheet is for someone else though I'd go with The Flying Ox, a maintenance job for life there


 
Posted : 09/03/2016 11:37 pm
Posts: 2642
Free Member
 

=INT(A1/0.05+0.999)*0.05


 
Posted : 10/03/2016 12:10 am
Posts: 208
Free Member
 

I [s]use[/s] used to use =ROUNDUP(C2*2,1)/2 but I'm liking dmorts' and molgrips' solutions.


 
Posted : 10/03/2016 4:17 am
Posts: 8652
Full Member
 

=INT(A1/0.05+0.999)*0.05

Surely this is the simple, no obscure function, use anywhere answer?


 
Posted : 10/03/2016 7:59 am
Posts: 1724
Full Member
 

The int function from tillydog works but you need another decimal space in the 0.05 so it's 0.005 for both.

My initial option was to do an if using the round and roundup functions. If they are the same answer you keep, if different you use round then add 0.005. Not as elegant as tillydog's though but simpler than TFOs.


 
Posted : 10/03/2016 8:39 am
Posts: 3351
Full Member
 

=if(MROUND(value,0.05)<value,MROUND(value+0.05,0.05),MROUND(value,0.05))

and

=CEILING(value,0.05)

Give the same results for the test cases I've just tried.... I knew it would 😀


 
Posted : 10/03/2016 9:45 am
Posts: 2642
Free Member
 

The int function from tillydog works but you need another decimal space in the 0.05 so it's 0.005 for both.

Only if you want to round to £0.005, not £0.05 😉


 
Posted : 10/03/2016 10:28 am
Posts: 0
Full Member
 

CEILING is nice and neat but won't work if someone is still using an old version of Excel.

So I'd probably go for ROUNDUP(C2*20,1)/20 to be safe.

(replace 20 with 1/x if you want to round up to £x instead of 5p)


 
Posted : 10/03/2016 12:05 pm
Posts: 77347
Free Member
 

CEILING is nice and neat but won't work if someone is still using an old version of Excel.

Help. [b].xlsx[/b] gurus.


 
Posted : 10/03/2016 12:45 pm
Posts: 0
Full Member
 

Seeing as he's asking this question, he's probably not aware of the difference, or the lack of backwards compatibility.


 
Posted : 10/03/2016 12:54 pm
 benz
Posts: 1143
Free Member
Topic starter
 

Well, you certainly learn many new things every day.

Thanks to those who directly contributed to my question.


 
Posted : 10/03/2016 7:46 pm

6 DAYS LEFT
We are currently at 95% of our target!