If odd then even...

MKTetzlaff

New Member
Joined
Apr 8, 2006
Messages
20
Hi:

I think that I am going about this wrong.

I have the length of a needed part (balance rod) in cell L127=rounddown((L108-2),0). We have switched vendors and now are only using even length balance rods.

L108 contains the product height divided by 2.
L127 (balance length) can never be less than 10 or more than 48.
L127 always needs to produce a even number but cannot be more than one less than actual number.

example: L127 = 27.375 --> rounddown to 27 (odd needs to be 26 so substract 1)
example: L127 = 36.875 --> rounddown to 36 (ok because it is even so substract 0)
example: L127 = 37.000 --> rounddown to 37 (odd needs to be 36 so substract 1)

If the part length (L127) is an even number, I do not need to do anything. If cell L127 is an odd number, I need to round down one / substract one to get to the even number below it.

I was thinking of trying to make the rounddown(), fix(), int() work in some combination but it also changes even numbers. This seems way too complicated for what appears to be easy on the surface.

I think I need some way to test if L127 is odd, maybe a If=odd/Then substract 1, If=even/Then substract 0.

I appreciate any help you guys can provide either on a way to test if a number (L127) is odd or just making this work in general.

Thanks in advance,

- Mike T.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
If your actual length is in L127, I think all you need to do is

FLOOR(L127,2)
 
Last edited:
Upvote 0
The Analysis ToolPak Add-In has ISEVEN and ISODD functions. Otherwise:

=MOD(INT(L127),2)

will return zero if even, otherwise 1.
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,238
Members
448,555
Latest member
RobertJones1986

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