We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

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

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

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 reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2021-05-13 11:24:11.941599

2 Answers

Sort by » oldest newest most voted

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

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



Spot on, Thank You.

horizon69 gravatar imagehorizon69 ( 2018-06-02 00:22:55 +0200 )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 +0200 )edit

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

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

Question Tools

1 follower


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

Seen: 1,619 times

Last updated: Jun 02 '18