# Excel odd even calculation

#### alliswell

##### New Member
Rate 4.5 for even and rate 5 for odd
In A1 is quantity and B1 is Result
I want is when i input odd number as quantity in A1 that is 5 then result should be 23 in b1. I calculated rate 4.5 for even and 5 for odd quantities. Suppose quantity is even that is 4 result comes as 18. And so on...
Thanks.

### Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

#### KRice

##### Board Regular
Try this...does it give the results you expect?
Book1
AB
1QuantityResult
215
329
4315
5418
6525
Sheet4
Cell Formulas
RangeFormula
B2:B6B2=IF(ISEVEN(A2),4.5*A2,5*A2)

#### Peter_SSs

##### MrExcel MVP, Moderator
.. or we could save a tiny bit by not repeating the original cell: 20 03 27.xlsm
AB
1QuantityResult
215
329
4315
5418
6525
Even Odd
Cell Formulas
RangeFormula
B2:B6B2=A2*IF(ISODD(A2),5,4.5)

Hopefully this was a typo?
I want is when i input odd number as quantity in A1 that is 5 then result should be 23 in b1

#### alliswell

##### New Member
Quantity 3 should come to 14 and quantity 5 should come to 23.
See now i will explain. in quantity 3, is one pair of even 4.5+4.5+5=14 in quantity 5, 4.5+4.5+4.5+4.5+5=23

#### Peter_SSs

##### MrExcel MVP, Moderator
Like this? If not, please give some more examples (including for even numbers) with the calculation steps.

20 03 27.xlsm
AB
1QuantityResult
215
329
4314
5418
6523
Even Odd
Cell Formulas
RangeFormula
B2:B6B2=FLOOR(A2,2)*4.5+5*ISODD(A2)