A
A
Alexey2020-07-22 03:25:53
excel
Alexey, 2020-07-22 03:25:53

Excel: Convert dimensions from mm to cm if some values ​​are string?

There is a file with several thousand lines.
The columns indicate the dimensions in millimeters. It can be either a number or a string. Example:
Length, mm
1310
560
870/930

The numbers are clear, we divide by 10 and that's it. But what about values ​​like "870/930" ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hint000, 2020-07-22
@lxnvr

for LibreOffice Calc:

=IF(ISNUMBER(A1),A1/10,CONCAT(TEXT(LEFT(A1,FIND("/",A1,1)-1)/10,"0"),"/",TEXT(RIGHT(A1,LEN(A1)-FIND("/",A1,1))/10,"0")))

for excel:
=ЕСЛИ(ЕЧИСЛО(A1);A1/10;СЦЕПИТЬ(ТЕКСТ(ЛЕВСИМВ(A1;ПОИСК("/";A1;1)-1)/10;"0");"/";ТЕКСТ(ПРАВСИМВ(A1;ДЛСТР(A1)-ПОИСК("/";A1;1))/10;"0")))

Works only for the given special case: either a number or two numbers separated by a slash. If there are other cases, then proceed on your own.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question