Need help with formula, please.

  • Thread starter Thread starter Emilio
  • Start date Start date
E

Emilio

Hi,

I am a newbie to excel formulas.
I have this: =IF(D12<10,10,D12)
This works ok except that if D12=0 it shows 10

Also I need that if D12= 12.3 the result shows as 12.5
(rounding to .5)
and if D12= 12.6 the result will show as 13

I hope is not confusing.
TIA,
Emilio
 
I think your arrow is pointing the wrong way--zero is
less than ten so it shows ten--need to point it to the
right since you are testing for greater than.

Just as an aside, sometimes I've run into tests like this
failing because the character of the number was in the
tested cell rather than the number--in other words it
looks like a number but when you go to the cell, there is
a little quote mark to the left of the number. In this
case reformatting is needed.
 
Thanks Frank for your response

I still get 10 if D12=0
and if D12= 15.67 I get 15.5 (but it should be 16)
Basically anything below ".5" should be ".5"
(example= 15.23 should be 15.5)
and anything above ".5" should go to next number
(example= 15.67 should be 16)

Thanks again
Emilio
 
Forgot to put my name

Thanks Frank for your response

I still get 10 if D12=0
and if D12= 15.67 I get 15.5 (but it should be 16)
Basically anything below ".5" should be ".5"
(example= 15.23 should be 15.5)
and anything above ".5" should go to next number
(example= 15.67 should be 16)

Thanks again
Emilio
 
Hi
what do you want for values <10? Do you mean:
=IF(D12<10,D12,CEILING(D12,0.5))
 
Thanks a lot, I am getting closer.
Everything works great except when D12 is less than 10,
say is 3.34 the answer should be 10
(anything less than 10 should be 10)

THANKS A LOT!

Emilio
 
Hi
now you're confusing me. In the previous post you said that you have an
issue that if D12=0 the formula returns 10. Now you're asking for a 10
if D12 is smaller than 10?

So then try:
=MAX(10,CEILING(D12,0.5))
 
Hi Frank,

Sorry to get you confused.
"(anything less than 10 should be 10)"
Except "0"
In that case the answer should be "0"

I hope this clarifies it.

Thanks again,
Emilio
 
Thanks again Frank,but I manage to figure it out myself

=IF(D12=0,0,IF(D12<10,10,IF(D12>10,D12,CEILING(D12,0.5))))

also I needed another formula which thru all these years
I have been entering manually because I didn't think it
could be done, too complex

=IF(D12<4,4,IF(D12<12,CEILING(D12,1),IF(D12>12,CEILING
(D12,0.5),IF(D12=12,(D12),))))

if D12 less than 4=4
and if D12 more than 12 (12.5, 13, 13.5,......)

ALL THANKS TO YOU!

Cheers,
Emilio
 
i gather you want answer to be 0 if d12 =0 try this
=IF(D12<10,IF(D12=0,0,10),ceiling(D12,0.5))
where ceiling forces D12 to the nearest 0.5
regds Rob
 
sorry for the xtra reply ceiling forces D12 to the next
0.5 not nearest
regds rob
 
[...]
also I needed another formula which thru all these years
I have been entering manually because I didn't think it
could be done, too complex

=IF(D12<4,4,IF(D12<12,CEILING(D12,1),IF(D12>12,CEILING
(D12,0.5),IF(D12=12,(D12),))))

if D12 less than 4=4
and if D12 more than 12 (12.5, 13, 13.5,......)
[...]

Looks like this also can be shortened to:

=CEILING(MAX(D12,4),1-(D12>12)*0.5)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top