Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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, -- John |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote: 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, -- John |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote: 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" wrote: 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, -- John |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jan 25, 11:59*am, John Savy
wrote: 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" wrote: 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" wrote: 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, -- John 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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote: 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" wrote: 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" wrote: 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, -- John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA programing | Excel Programming | |||
Programing cell comments | Excel Programming | |||
Programing help | Excel Programming | |||
VB programing | Excel Programming | |||
Help with VBA programing | Excel Programming |