A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

function to find if a number is whole



 
 
Thread Tools Display Modes
  #1  
Old August 15th, 2006, 08:05 PM posted to microsoft.public.excel.newusers
::Cory::
external usenet poster
 
Posts: 3
Default function to find if a number is whole

Does anyone know of a function to determine if a number is a whole integer
and not a decimal place?

I want to target a cell (that has a sum value in it) and create an if
statement if it's a whole number or not.

::CORY::


  #2  
Old August 15th, 2006, 08:14 PM posted to microsoft.public.excel.newusers
SteveW
external usenet poster
 
Posts: 399
Default function to find if a number is whole

Assume A1 has number in it

=if( INT(a1)=a1, True, False)

On Tue, 15 Aug 2006 20:05:56 +0100, ::Cory:: wrote:

Does anyone know of a function to determine if a number is a whole
integer
and not a decimal place?

I want to target a cell (that has a sum value in it) and create an if
statement if it's a whole number or not.

::CORY::





--
Steve (3)
  #3  
Old August 15th, 2006, 08:16 PM posted to microsoft.public.excel.newusers
Niek Otten
external usenet poster
 
Posts: 2,533
Default function to find if a number is whole

=MOD(A1,1)=0

Returns TRUE or FALSE

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"::Cory::" wrote in message ...
| Does anyone know of a function to determine if a number is a whole integer
| and not a decimal place?
|
| I want to target a cell (that has a sum value in it) and create an if
| statement if it's a whole number or not.
|
| ::CORY::
|
|


  #4  
Old August 15th, 2006, 08:22 PM posted to microsoft.public.excel.newusers
::Cory::
external usenet poster
 
Posts: 3
Default function to find if a number is whole

Unless I am dense, neither of these replies worked.

A1 value is 4.00 on my sheet is that my problem?

::CORY::



"::Cory::" wrote in message
...
Does anyone know of a function to determine if a number is a whole integer
and not a decimal place?

I want to target a cell (that has a sum value in it) and create an if
statement if it's a whole number or not.

::CORY::



  #5  
Old August 15th, 2006, 08:23 PM posted to microsoft.public.excel.newusers
::Cory::
external usenet poster
 
Posts: 3
Default function to find if a number is whole

Nevermind. I found my error.

Thanks for the fast help guys!

::CORY::


"::Cory::" wrote in message
...
Unless I am dense, neither of these replies worked.

A1 value is 4.00 on my sheet is that my problem?

::CORY::



"::Cory::" wrote in message
...
Does anyone know of a function to determine if a number is a whole
integer and not a decimal place?

I want to target a cell (that has a sum value in it) and create an if
statement if it's a whole number or not.

::CORY::





  #6  
Old August 15th, 2006, 08:25 PM posted to microsoft.public.excel.newusers
Niek Otten
external usenet poster
 
Posts: 2,533
Default function to find if a number is whole

A1 value is 4.00

It probably isn't; 4.00 is what it shows, not what the value is. Format A1 as General and widen the column to its maximum. What do
you see?

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


"::Cory::" wrote in message ...
| Unless I am dense, neither of these replies worked.
|
| A1 value is 4.00 on my sheet is that my problem?
|
| ::CORY::
|
|
|
| "::Cory::" wrote in message
| ...
| Does anyone know of a function to determine if a number is a whole integer
| and not a decimal place?
|
| I want to target a cell (that has a sum value in it) and create an if
| statement if it's a whole number or not.
|
| ::CORY::
|
|
|


  #7  
Old August 15th, 2006, 08:29 PM posted to microsoft.public.excel.newusers
SteveW
external usenet poster
 
Posts: 399
Default function to find if a number is whole

If the value is 4.0 and displayed as 4.00 - no problem
if on the other hand the value is 4.001 and formated to show 2 decimal
places then yes it's correct

modify the formula to this

=if( abs(int(a1)-a1)0.000001, true, false)

You can *alter the accuracy* by altering the 0.000001

Steve


On Tue, 15 Aug 2006 20:22:16 +0100, ::Cory:: wrote:

Unless I am dense, neither of these replies worked.

A1 value is 4.00 on my sheet is that my problem?

::CORY::



"::Cory::" wrote in message
...
Does anyone know of a function to determine if a number is a whole
integer
and not a decimal place?

I want to target a cell (that has a sum value in it) and create an if
statement if it's a whole number or not.

::CORY::






--
Steve (3)
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:32 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.