jeudi 28 février 2019

Google Sheets MID formula outputs weird value not compatible with IF function

In Google Sheets, the MID formula seems to output a weird value type that doesn't work well with comparison functions, namely IF.

Below, The Row 1 shows the function in each cell, Row 2 show the column names, and Row 3 shows the values.

Each cell with a number is of type Custom Number Format: 123

 SOURCE      "=IF($A2>123,$A2-1,$A2)"   "=MID($A2,1,3)" "=IF($C2>123,$C2-1,$C2)"

 Col A        Col B                      Col C            Col D
 ---------------------------------------------------------------
 123          123                        123              122

The expected output from the IF check in Col D on the MID output is 123, yet it's outputting 122 (even though 123 is NOT greater than 123).

Even if I change the formats of each cell to Number 1,000.12, the IF check on MID's output is wrong.

Why is this?

Aucun commentaire:

Enregistrer un commentaire