You are here:

# Excel/How to get the series

Advertisement

Question
Hi Bob,

I have a number 12653. In column A, cell a2 there is '12', cell a3 there is '65', cell a4, '253'. This means that at cell a4 I get my whole number '12653' with the previous numbers considered in common. In a given column with a very large number of such different permutations, how can I directly arrive at the cell where all the digits of my original number get reconciled?

Thanks in advance.

Answer
Best to use a UDF (User-Defined Function).
In A4, enter =UniqueDigits(A2:A4)

Get to the VBE (Alt/F11), use Insert/Module, put this in:

Function UniqueDigits(Rg As Range) As Long
Dim ans As New Collection, temp As Long
On Error Resume Next
For Each thing In Rg
For i = 1 To Len(thing)
ans.Add CStr(Mid(thing, i, 1)), CStr(Mid(thing, i, 1))
Next
Next
n = 0
For i = ans.Count To 1 Step -1
temp = ans.Item(i) * 10 ^ n + temp
n = n + 1
Next
UniqueDigits = temp
End Function
Questioner's Rating
 Rating(1-10) Knowledgeability = 10 Clarity of Response = 10 Politeness = 10 Comment No Comment

• Add to this Answer
• Ask a Question
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

#### Bob Umlas

##### Expertise

I`m a Microsoft Excel MVP (Most Valuable Professional) and have been since the inception of the program in 1995. I can answer every kind of Excel question except: API, Importing/exporting to other programs (powerpoint, word,...) Also check out my in-person training link at http://www.thumbtack.com/ny/new-york/excel-training/

##### Experience

Worked with MS Excel since version 0.99 (on the Mac!). Was contributing editor to Excellence Magazine, having written >300 articles. John Walkenbach said of me "I finally met someone who knows as much about Excel as I do."

Publications
Excellence, The Expert, Microsoft

Education/Credentials
BA in math, Hofstra University, 1965

Awards and Honors
MVP
Led sessions for the Convergence 2004-2006 seminar on Excel tips & tricks

©2017 About.com. All rights reserved.

Browse Answers:

[an error occurred while processing this directive]