Hi!
I have data in the following format in say column A:
A1: 1.0
A2: 1.5
A3: 2.0
A4: 2.5
A5: 3.0
etc. I'm trying to find out if it is possible with an IF statement of similar
to do a calculation if the data is 1.0, 2.0 or 3.0. That is, I don't want to
do a calculation if the data is 1.5, 2.5 etc. I tried the ISEVEN and
ROUND functions without any luck.
The problem shall solve price differences when you don't have even number
of say doughnuts. If you sell 2 doughnuts you have the price for just two
doughnuts. But if someone wants 2.5 doughnuts the price shall be calculated
for 2.5 doughnuts and an additional split charge as well.
2 doughnuts -> price = A3*price per doughnuts
2.5 doughnuts -> price = A4*price per doughnuts + split charge
Kind Regards
akphidelt - 12 May 2008 23:00 GMT
Try this
=If(Mod(A1,1)=0,A1*Price,A1*Price + Split Charge)
Mod takes the remainder of dividing A1 by 1. So if its 1.5 the answer will
be .5
> Hi!
>
[quoted text clipped - 20 lines]
>
> Kind Regards
Rocketeer - 13 May 2008 12:39 GMT
Thank you all. This formula made the trick.
Regards
/Peter
> Try this
>
[quoted text clipped - 27 lines]
> >
> > Kind Regards
T. Valko - 12 May 2008 23:05 GMT
Not sure what result you're looking for but this formula will sum only the
whole numbers in the range:
=SUMPRODUCT(--(MOD(A1:A5,1)=0),A1:A5)
And this formula will sum only numbers that have a decimal:
=SUMPRODUCT(--(MOD(A1:A5,1)>0),A1:A5)

Signature
Biff
Microsoft Excel MVP
> Hi!
>
[quoted text clipped - 23 lines]
>
> Kind Regards
Sandy Mann - 12 May 2008 23:41 GMT
Try something like:
Any number of doughnuts
price = A3*price per doughnuts + (split charge *(MOD(A3),1<>0)

Signature
HTH
Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings
sandymann2@mailinator.com
Replace @mailinator.com with @tiscali.co.uk
> Hi!
>
[quoted text clipped - 23 lines]
>
> Kind Regards