Windstorm1981
Windstorm1981

Reputation: 2680

Determining If the Cell Contents are Equal in Excel

I am trying to see if the numerical values in two cells are equivalent.

My problem is that one cell is text formatted and the number has one decimal precision and the other numerical format with 7 decimals precision.

I want to see if they are both equal to one decimal precision and I can't figure out how to do it.

So, the values in my cells look like this:

numerical         text
  5.6%             5.6%

But the real values are:

numerical        text
5.56650625%       5.6%

How can I test do this?

Thanks in advance.

Upvotes: 0

Views: 299

Answers (2)

pnuts
pnuts

Reputation: 59485

To avoid any floating point imprecision I suggest comparing Text to Text so if the Numeric version is in A1, in say A4:

=TEXT(ROUND(A1*100,1),"General")&"%"

With the Text version in B1:

=B1=A4  

returns TRUE.

Working on the Text version to try to bring it 'into line' with the other is pointless because it simply does not have all the decimal places that the Number format version has.

Upvotes: 0

JGFMK
JGFMK

Reputation: 8904

You can convert text to number with VALUE(text). You can use ROUND(number, number of digit). There is also CEILING and FLOOR you may want to play around with. But that should point you in the right direction.

Upvotes: 2

Related Questions