Ask Your Question
1

How do I test cell for a whole integer (non fractional) and return the value if it is and a blank if not?

asked 2018-06-01 23:10:15 +0100

horizon69 gravatar image

Have a Series of cells with a formula. I would like to hide and/or return a blank on any cell that less than or more than a whole number. (example .5, 1.25, etc. would not be shown, but 2, 4, etc. would be.

Ps It's been 10yrs since attempting to program. I hope this helps, Thank You

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2018-06-01 23:54:56 +0100

hjek gravatar image

Assuming your numbers are in column A, you can put this in B1 and fill down the B colum: =IF(MOD(A1,1)=0,A1,"")

edit flag offensive delete link more

Comments

1

Spot on, Thank You.

horizon69 gravatar imagehorizon69 ( 2018-06-02 00:22:55 +0100 )edit

Glad it worked for you.

I think you're meant to click the gray check mark circle to the left of my answer to indicate that your question has been answered.

hjek gravatar imagehjek ( 2018-06-02 00:58:51 +0100 )edit
2

answered 2018-06-02 01:26:22 +0100

Lupp gravatar image

Hopefully the Original Questioner is aware of the fact that trusting in computers with this kind of questions comes with risks.

It heavily depends on the kind of "a formula" if its result will be exact enough to allow for distinguishing between integer and non-integer results reliably as needed.

See this attached example.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-06-01 23:10:15 +0100

Seen: 557 times

Last updated: Jun 02 '18