Whole Numbers

stapuff

Well-known Member
Joined
Feb 19, 2004
Messages
1,126
I have following as a field:

Qty: [SHIP_QUANTITY]*-1/[PMCUBE]

I do not want to see and records where the result is not a whole number. One thing I do not want to do is round the number and I can not change how the data comes into the tables I am quering.

Any suggestions would be appreciated.

Kurt
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
I have this figured out:

1st field:
Qty: [SHIP_QUANTITY]*-1/[PMCUBE]

add another field
2nd field
Qty1: IIf(Int([SHIP_QUANTITY]*-1/[PMCUBE])=[SHIP_QUANTITY]*-1/[PMCUBE],1,0)

in the criteria of the 2nd field - put a 1.

Using the int - the decimal is turned into and Interger and checked against itself. If it is a decimal - field 2 should be a 0 if the match 1.

Kurt
 
Upvote 0
In one field is possible maybe?

IIf(Int([SHIP_QUANTITY]*-1/[PMCUBE])=[SHIP_QUANTITY]*-1/[PMCUBE],Int([SHIP_QUANTITY]*-1/[PMCUBE])=[SHIP_QUANTITY]*-1/[PMCUBE],0)
 
Upvote 0
Or,

Iif([SHIP_QUANTITY] Mod [PMCUBE])=0,([SHIP_QUANTITY]*-1/[PMCUBE]),0)

Another option:

(([SHIP_QUANTITY] Mod [PMCUBE])=0)*([SHIP_QUANTITY]/[PMCUBE])

If the remainder is 0, you have a whole number. The first option spells it out with an Iif statement. With the second option, the first half of the equation will evaluate to TRUE (-1) or FALSE (0).

Denis
 
Upvote 0
Alexander & Denis -

I like your suggested alternatives. I appreciate the support.

Kurt
 
Upvote 0

Forum statistics

Threads
1,203,563
Messages
6,056,092
Members
444,846
Latest member
pbailey

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