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

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
=(A1-TRUNC(A1)=0)+0

Custom format the formula cell as:

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

if needed.

Otherwise:

1 --> Yes
0 --> No
 
Upvote 0
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,
 
Upvote 0

Forum statistics

Threads
1,214,645
Messages
6,120,711
Members
448,984
Latest member
foxpro

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
Back
Top