ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cell Programing (https://www.excelbanter.com/excel-programming/422951-cell-programing.html)

John Savy

Cell Programing
 
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

OssieMac

Cell Programing
 
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


John Savy

Cell Programing
 
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


Ayush Jain

Cell Programing
 
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

OssieMac

Cell Programing
 
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



All times are GMT +1. The time now is 07:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com