rounding down only odd numbers in a column

  • Thread starter Thread starter learninginmn
  • Start date Start date
L

learninginmn

Here is my problem. I am trying to figure out the total number of boxes
on a flat surface of shipping palate. The numbers in my chart could be
1,2,3,4,5 in a column. But I need to subtract 1 from all the odd
numbers so the result is this: 1 to stay 1; 2=2, 3=2 4=4, 5=4. Any
suggestions?
 
If your data started in A1
=IF(A1=1,A1,IF(NOT(MOD(A1,2)=0),A1-1,A1))

Drag the formula down as far as your data goes in that column.
 
Here is my problem. I am trying to figure out the total number of boxes
on a flat surface of shipping palate. The numbers in my chart could be
1,2,3,4,5 in a column. But I need to subtract 1 from all the odd
numbers so the result is this: 1 to stay 1; 2=2, 3=2 4=4, 5=4. Any
suggestions?


=MAX(1,FLOOR(A1,2))


--ron
 
Myrna,

it fails on 1

here's another

=(A1=1)+ROUNDDOWN(A1/2,0)*2

--

Regards,

Peo Sjoblom

Myrna Larson said:
To add yet another formula:

=A1-MOD(A1,2)
 
Ah, I missed the piece about leaving 1 as-is. Thanks for the correction.
 

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