ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Make a decimal number return to zero (https://www.excelbanter.com/excel-discussion-misc-queries/452453-make-decimal-number-return-zero.html)

[email protected]

Make a decimal number return to zero
 
I am looking to make a decimal number return to zero. Example

if AI EQUALS 37.5

I want to do a formula that divides AI by 2 and when it comes out to 18.75 which is not a whole number then it should state the cell as zero if it is a whole number then it would return the whole number to that cell.

zvkmpw

Make a decimal number return to zero
 
On Wednesday, October 19, 2016 at 10:36:20 AM UTC-7, wrote:
I am looking to make a decimal number return to zero. Example

if AI EQUALS 37.5

I want to do a formula that divides AI by 2 and when it comes out to 18.75
which is not a whole number then it should state the cell as zero if it is
a whole number then it would return the whole number to that cell.


Maybe something like this:
=IF((A1/2) = INT(A1/2), A1/2, 0)

mikerickson

Quote:

Originally Posted by (Post 1626389)
I am looking to make a decimal number return to zero. Example

if AI EQUALS 37.5

I want to do a formula that divides AI by 2 and when it comes out to 18.75 which is not a whole number then it should state the cell as zero if it is a whole number then it would return the whole number to that cell.

I'm not sure if you are looking for =INT(A1/2)

or =(A1/2)*(1-SIGN(MOD(A1/2,1))


All times are GMT +1. The time now is 02:20 AM.

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