Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula to Determine if a String Value is Even or Odd

Status
Not open for further replies.

jpstrzoch

Technical User
Mar 24, 2004
59
US
Greetings,

I have a warehouse storage location code. Example, "BUGG11F". This field is a string. I've used the following formula to return a portion of the location code. MID({Sheet1_.bin_num},5,2). This returns an "11" result, itself a string value.

How do I write a formula to consider whether the above formula result is either odd or even? In the example above, I would anticipate an "Odd", result because the string value when converted, using ToNumber would return the numeric value of 11, thus, Odd.

Let me know

Thanks!
 
if Remainder(val(MID({Sheet1_.bin_num},5,2)),2) = 0 then
"Even" else "Odd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top