Best way to convert data from an unknown unit (cm OR inches) ?

I need to fill in two columns in a table, one for length in inches, one for length in cm. I know how to use the conversion function, but my problem is this: sometimes I am given the data in cm, sometimes it's in in - so I can't just have one column convert from the other. Can anyone suggest the best way to handle this?


Just to help clarify, I have something like this:


Length IN    |      Length CM
5            |      -
-            |      8
2            |      -
7            |      -
-            |      10

etc...

and need to fill in the missing data.

Posted on Jul 17, 2022 6:50 AM

Reply
Question marked as Top-ranking reply

Posted on Jul 17, 2022 12:12 PM

Here is another option:



Enter your length in column B. Columns C and D convert it to inches and centimeters.

Formula in C2 =IFERROR(CONVERT(REGEX.EXTRACT($B2,"[\d.,]+"),REGEX.EXTRACT($B2,"[a-zA-Z]+"),C$1),"")

Fill to D2 then fill down to complete the columns


Format column B as text if you ever want to use "m" for meters, otherwise Numbers will think it is minutes.


(I edited the formula after I posted it originally so that it now uses the units in C1 and D1 to determine what the columns should be)


5 replies
Question marked as Top-ranking reply

Jul 17, 2022 12:12 PM in response to rdyornot77

Here is another option:



Enter your length in column B. Columns C and D convert it to inches and centimeters.

Formula in C2 =IFERROR(CONVERT(REGEX.EXTRACT($B2,"[\d.,]+"),REGEX.EXTRACT($B2,"[a-zA-Z]+"),C$1),"")

Fill to D2 then fill down to complete the columns


Format column B as text if you ever want to use "m" for meters, otherwise Numbers will think it is minutes.


(I edited the formula after I posted it originally so that it now uses the units in C1 and D1 to determine what the columns should be)


Jul 17, 2022 8:22 AM in response to rdyornot77

You would need a third column, call it whatever you like. Anything else would be self-referential.


The other option is to create the conversion formula in each column, so that every cell in "inches" has the formula to convert the adjacent cell. And vice versa. But, then you're overwriting the formula when you add the actual number. Eg. you would type 5 in inches which would replace the formula with 5. That might be ok in your case, but the third column is non-destructive.



Jul 17, 2022 11:25 AM in response to rdyornot77

Another option:


This one uses two input columns, one for values in Inches, the second for values in cm. In each row, the cell not matching the unit for the entered value is left empty. The numerical value only is entered in the column matching its unit.


Columns C and D similar formulas that sum the entered value in the entry column matching the unit of 'this column' and the converted value of 'the other column'. Formulas for these two columns are shown below the table as entered in C2 and D2, and filled down from there.


Regards,

Barry

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Best way to convert data from an unknown unit (cm OR inches) ?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.