ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Using Roundup in an IF Statement (https://www.excelbanter.com/excel-worksheet-functions/250490-using-roundup-if-statement.html)

LBW[_2_]

Using Roundup in an IF Statement
 
This is probably simple but I can't get it to work. I need to have
the number in D10, if is less than 50000, rounded up to the nearest
hundred. Then I need to apply the formula (((D10/1000)*0.23)*12) to
the rounded up number. If the number in D10 is 50,000 or more, the
formula should return a hard number, in this case it will be 138.

=IF((D10*1)<50000, roundup ((d10*1),2), (((D10/1000)*0.23)*12),138)

Lars-Åke Aspelin[_2_]

Using Roundup in an IF Statement
 
On Tue, 8 Dec 2009 11:14:33 -0800 (PST), LBW
wrote:

This is probably simple but I can't get it to work. I need to have
the number in D10, if is less than 50000, rounded up to the nearest
hundred. Then I need to apply the formula (((D10/1000)*0.23)*12) to
the rounded up number. If the number in D10 is 50,000 or more, the
formula should return a hard number, in this case it will be 138.

=IF((D10*1)<50000, roundup ((d10*1),2), (((D10/1000)*0.23)*12),138)



Try this formula:

=IF(D10<50000,ROUNDUP(D10,-2)*0.00276,138)

Hope this helps / Lars-Åke

Joe User[_2_]

Using Roundup in an IF Statement
 
"LBW" wrote:
rounded up to the nearest hundred.
[....]roundup ((d10*1),2)


Your ROUNDUP usage rounds up to the nearest hundredth (0.01), not the
nearest hundred (100). Which do you want?

As always, a numerical example would have been helpful to resolve
ambiguities and mistakes in the English description.

Noting that 50*0.23*12 is 138, I suspect the following is what you want to
compute:

=MIN(138, 0.23*12*ROUNDUP(D10,-2)/1000)

But if you want the result to be dollars or dollars and cents, use one of
the following:

dollars: =MIN(138, ROUND(0.23*12*ROUNDUP(D10,-2)/1000, 0))

cents: =MIN(138, ROUND(0.23*12*ROUNDUP(D10,-2)/1000, 2))

Change D10 to D10*1 or --D10 only if D10 is text (TYPE(D10)=2), not numeric
(TYPE(D10)=1). But why is D10 text?


----- original message -----

"LBW" wrote in message
...
This is probably simple but I can't get it to work. I need to have
the number in D10, if is less than 50000, rounded up to the nearest
hundred. Then I need to apply the formula (((D10/1000)*0.23)*12) to
the rounded up number. If the number in D10 is 50,000 or more, the
formula should return a hard number, in this case it will be 138.

=IF((D10*1)<50000, roundup ((d10*1),2), (((D10/1000)*0.23)*12),138)




All times are GMT +1. The time now is 01:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com