# How to check if a cell contains "%" and calculate accordingly.

Solved/Closed
N245 - Mar 24, 2015 at 06:04 PM
Saurabh - Oct 18, 2019 at 02:46 PM
I am wondering how to do that?

I learnt no basics, just went on by myself trying to figure out things and so here is what I am trying to do..

Basically, if cell B2 contains a whole number (say 10), then cell C2 returns that flat value, but if cell B2 contains a percentage, then C2 performs a simple equation (i.e.: B2*B1)

It's just I am not sure how to define if a cell has a specific symbol/text so it can perform the equation needed, else disregard.

How I vision it could've been (tried but failed)"
IF(B2="#%", B2*B1, B2) -- if I understood that function correctly, if B2 contains a percentage, it would multiply B2 by B1, if not, it will return B2 value.. regardless of that, it always returns B2 value, even if it is with a percentage.

Help will be appreciated.

## 2 responses

MaxStart Posts 339 Registration date Tuesday March 3, 2015 Status Moderator Last seen July 3, 2015 69
Mar 25, 2015 at 07:23 PM
`=IF(RIGHT(B2,1)="%",B2*B1,B2)`

please follow-up with us if it works for you.
--
Damn it !!!, is it ever gonna be the way I want it to be?
Works like a charm!

Could you possibly explain what does the function "right" mean?
MaxStart Posts 339 Registration date Tuesday March 3, 2015 Status Moderator Last seen July 3, 2015 69
Mar 26, 2015 at 04:46 AM
it will return characters from the string starting from the right, number of characters in this case is 1
Thanks Max