IF a whole number then...

wwbwb

Well-known Member
Joined
Oct 20, 2003
Messages
513
I'm trying to set up a formula so that if the number in a1 is a whole number then the formula will return "Yes" otherwise "No". This is what I have so far, just wondering if there is a simpler way?

=if(round(a1,0)=a1,"Yes","No")
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
=(A1-TRUNC(A1)=0)+0

Custom format the formula cell as:

[=0]"No";[=1]"Yes"

if needed.

Otherwise:

1 --> Yes
0 --> No
 

Anthony47

Well-known Member
Joined
Mar 29, 2006
Messages
2,237
Hi wwbwb,
your formula is ok, or you could use
Code:
=IF(MOD(A1,1),"No","Yes")
or
Code:
=IF(INT(A1)=A1,"Yes","No"

But, as you see, they have all the same (limited) complexity.
Bye,
 

Forum statistics

Threads
1,141,596
Messages
5,707,303
Members
421,502
Latest member
PULBAG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top