Check if content in cell is an integer

P

prem

How do I check if the content in a cell, when divided by 4, returns an
integer? It should give me 150 if it is an integer and display "NA" if it is
not an integer.

For example, the formula should check if the content A2 divided by 4 is an
integer and display the necessary answer in cell C2.

Hopefully the formula can be use to check any corresponding cell in this
manner. I.E check if content in cell A3 when divided by 4 is an integer and
display the necessary in cell C3, check if content in cell A4 when divided
by 4 is an integer and diaplay the necessary in cell C4 and so on.

Thank you for your help.
 
P

Per Jessen

Hi

Enter this formula in C2 and copy it down the desired range.

=IF(MOD(A2;4)=0;150;"NA")

Regards,
Per
 
M

MartinW

Hi Prem,

Just expanding on Mike's solution,

This will return 150 as a number
=IF(MOD(A2,4)=0,150,"NA")

And this will return 150 as a text value
=IF(MOD(A2,4)=0,"150","NA")

Grab the fill handle and drag down as far as
is needed.

HTH
Martin
 
P

prem

Hi guys thank you for all the help. Really appreciate it. Its all working
well now. Thank you.
 
M

MartinW

Glad it worked for you, thanks for posting back,
I'm sure Mike and Per appreciate it as much as I do.

Regards
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top