changing cell fomats

  • Thread starter Thread starter Darryl
  • Start date Start date
D

Darryl

What is the formula to change cell formats from "112234501" to look like "
112-23-4501"
 
I have two columns that should have the same numbers. One columns is
formatted like "112234501" and the other "112-23-4501" I am trying to find
the rows that do not match. So, I want to create a formula in a third column
to show cells in rows that do not match. When I change the format as you
suggest, the true value remains 112234501. And, 112234501 (minus)
112-23-4501 cannot be calculated. Can you help?
 
If the nos like 112-23-4501 are in Col B (and numbers to compare in Col A)
then in
C1 enter
=(SUBSTITUTE(B1,"-",""))*1

Now you can use something like
=IF(A1=C1,"Same","Different") in D1 to compare

Copy down the formulae to the end of your data set
 
You can check to see if the number 112234501 appears in the other column as text
(112-23-4501) by using:

=isnumber(match(text(a1,"000-00-0000"),b:b,0))

Where A1 holds a number and column B holds the text values.

You could use the same kind of thing to see if the text values show up in the
number column:

=isnumber(match(--substitute(b1,"-",""),a:a,0))

The =substitute() will remove the hyphens, but return text values
The -- will coerce the text values to a real number.
 
thanks much

Sheeloo said:
If the nos like 112-23-4501 are in Col B (and numbers to compare in Col A)
then in
C1 enter
=(SUBSTITUTE(B1,"-",""))*1

Now you can use something like
=IF(A1=C1,"Same","Different") in D1 to compare

Copy down the formulae to the end of your data set
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Format cell - Miles 5
SUMPRODUCT macro 2
Number Format question 3
MROUND time 2
Sumif cells of a certain format 3
Bold format. 2
Formatting cells 4
Cell Format on Imported Data 3

Back
Top