Search code examples
google-sheetsmodulogoogle-workspaceunit-conversion

Google Sheets - Why are there garbage digits in MOD(??)&"*"?


tl;dr - why am I getting these weird remainders in MOD()&"*", which are not showing up in MOD()?

On behalf of an old-timey cheesemonger acquaintance of mine, I'm trying to convert a value from ounces to pounds and ounces. When I build a conversion formula, though, I am sometimes getting some weird remainders.

Screengrab from Google Sheets

  • Column D is the source number of ounces.
  • Column E is just =MOD(D?)
  • Column F is =MOD(D?)&" oz.", but the content doesn't matter - any concatenation of that cell blows out a weird remainder...but only for some values?

Why is this happening? Is there a single-column method to fix this?


Solution

  • I feel like I'm committing some kind of sin, but this seems to be gouda enough.

    Column E now runs:

    =INT(D4/16)&" lb. "&ROUND(MOD(D4,16),1)&" oz."