Format Text to Number

B

Bruce D.

I am using excel 2007 and I am trying to create a macro that will convert
account numbers which are stored as text to a number format. I want to get a
record count on how many account numbers there are. Any ideas?

Thanks,
 
R

Ron Rosenfeld

I am using excel 2007 and I am trying to create a macro that will convert
account numbers which are stored as text to a number format. I want to get a
record count on how many account numbers there are. Any ideas?

Thanks,

If there are no duplicates, you can use COUNTA.

If there might be duplicates, you can use this formula which must be
**array-entered**:

=SUM(IF(FREQUENCY(IF(LEN(A1:A1000)>0,MATCH(A1:A1000,A1:A1000,0),""),
IF(LEN(A1:A1000)>0,MATCH(A1:A1000,A1:A1000,0),""))>0,1))
----------------------------------------
To **array-enter** a formula, after entering
the formula into the cell or formula bar, hold down
<ctrl><shift> while hitting <enter>. If you did this
correctly, Excel will place braces {...} around the formula.



Be aware that if you use Paul C's solution (or any solution that involves
changing the text to numbers), you will drop any leading zeros, and any digits
after the first 15 will get changed to a zero.

--ron
 

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

Top