1

I need to substract the last number of a 3 digit number (in fact a two decimal of comma number). I do this with the function:

=RIGHT(A1;1)

The result I got is correct.

After I need to "round" this number. If the number is between 2 & 6 it should be 4, otherwise it should be 9. I use this function for this:

=IF(AND((A2<7);(A2>1));4;9)

Strangely, the function is not working on the "RIGHT" function here first mentioned, but if I enter the value 'hardcoded' in a cell, and use the same function from here above it's working like a charm. I was first thinking it had to do with the cell where the result was: text, number,... But even after changing it into text it's still not working correctly.

printscreen

Any idea what the problem could be ? Thanks for your time.

1
  • 2
    The RIGHT formula coverts the number to a string (text), you can see that text gets automatically aligned left in the cell and numbers are aligned right. Commented Jan 30, 2020 at 13:18

2 Answers 2

1

When you use =RIGHT(A1;1), I think it's returning a text result. Try =VALUE(RIGHT(A1;1)). It worked for me.

Sign up to request clarification or add additional context in comments.

Comments

0

Try:

=IF(AND((RIGHT(A1;1)*1)>1;(RIGHT(A1;1)*1)<7);4;9)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.