Cell Programing

J

John Savy

Could you show me how to write this program:
if[sum((A1)+(A2))/5] would have decimal points then "blank", not to show
otherwise the result.
In other words I'm looking for the result without decimal point and if the
result has decimal point, it would be out of scop of the purpose, therefore
I'm not interested on the result.
Thanks,
 
O

OssieMac

Hi John,

=IF(MOD(SUM(A1:A2),5)>0,"",SUM(A1:A2))

The above places a null value (which is represented by the double quotes) if
division by 5 does not return a whole number; otherwise will sum the range.
 
J

John Savy

Thanks for reply,
I tried and didn't work. It gives formula error.
Again, I'm looking non-decimal figures.
For example, A1=4, A2= 6, so sum((A1+A2)/5) = 2; therefore the program
should show #2, if it was 2.45, I shouldn't show, since the result has
decimal points.
Thaks,

--
John


OssieMac said:
Hi John,

=IF(MOD(SUM(A1:A2),5)>0,"",SUM(A1:A2))

The above places a null value (which is represented by the double quotes) if
division by 5 does not return a whole number; otherwise will sum the range.

--
Regards,

OssieMac


John Savy said:
Could you show me how to write this program:
if[sum((A1)+(A2))/5] would have decimal points then "blank", not to show
otherwise the result.
In other words I'm looking for the result without decimal point and if the
result has decimal point, it would be out of scop of the purpose, therefore
I'm not interested on the result.
Thanks,
 
A

Ayush Jain

Thanks for reply,
I tried and didn't work. It gives formula error.
Again, I'm looking non-decimal figures.
For example, A1=4, A2= 6, so   sum((A1+A2)/5) = 2; therefore the program
should show #2, if it was 2.45, I shouldn't show, since the result has
decimal points.
Thaks,

--
John

OssieMac said:
Hi John,
=IF(MOD(SUM(A1:A2),5)>0,"",SUM(A1:A2))

The above places a null value (which is represented by the double quotes) if
division by 5 does not return a whole number; otherwise will sum the range.

Could you show me how to write this program:
if[sum((A1)+(A2))/5] would have decimal points then "blank", not to show
otherwise the result.
In other words I'm looking for the result without decimal point and if the
result has decimal point, it would be out of scop of the purpose, therefore
I'm not interested on the result.
Thanks,

I think the formula of Ossie Mac is almost right except the false
condition.. The right formula should be :

=IF(MOD(SUM(A1:A2),5)>0,"",(SUM(A1:A2)/5))

-Ayush Jain
http://groups.google.com/group/excel-macros
 
O

OssieMac

Hi again John,

I forgot to divide by 5 in the second part but should not have returned a
formula error; just the wrong answer. Try the following. Works fine in xl2002
and xl2007.

=IF(MOD(SUM(A1:A2),5)>0,"",SUM(A1:A2)/5)

If still returning an error, what version of xl are you using?

--
Regards,

OssieMac


John Savy said:
Thanks for reply,
I tried and didn't work. It gives formula error.
Again, I'm looking non-decimal figures.
For example, A1=4, A2= 6, so sum((A1+A2)/5) = 2; therefore the program
should show #2, if it was 2.45, I shouldn't show, since the result has
decimal points.
Thaks,

--
John


OssieMac said:
Hi John,

=IF(MOD(SUM(A1:A2),5)>0,"",SUM(A1:A2))

The above places a null value (which is represented by the double quotes) if
division by 5 does not return a whole number; otherwise will sum the range.

--
Regards,

OssieMac


John Savy said:
Could you show me how to write this program:
if[sum((A1)+(A2))/5] would have decimal points then "blank", not to show
otherwise the result.
In other words I'm looking for the result without decimal point and if the
result has decimal point, it would be out of scop of the purpose, therefore
I'm not interested on the result.
Thanks,
 

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

Top