2

So I have a data like this :

(First Number) (=RIGHT(A1, 3))
19132 132
56112 112

So, the second column formula is =RIGHT(A1,3) and so on. When I created the graph, it's show zero data, there are no data in the graph.

But when I tried change the second column with data (not a formula), the graph can read the data now...

Why doesn't my LibreOffice Calc read any data if I put formula into the cell?

1

LO Calc can't create a chart based on the column B's values because they are text strings instead of numerical values. This is because RIGHT() is a text function, trying to read the input as string and returning a string. The solution is just to apply to VALUE() function to the output of the RIGHT() function, so that the result of the complete formula is an integer:

=VALUE(RIGHT(A1,3))

You can check the type of a cell's content using one of the information functions. The TYPE() function returns an integer indicating the type, the ISTEXT() and ISNUMBER() functions return true or false.

An easier way would be to use the MOD() function:

=MOD(A1, 1000)

returns the remainder of A1 divided by 1000, so it effectively strips the part of the number > 999. With A1 = 314972, MOD(A1, 1000) will return 972. This way, you could get rid of the type conversion number -> string -> number.

Here's an overview of the different solutions:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.