Extract last few digits from a cell

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
950
I have value in column C5:C9999. It contains alphanumeric along with special characters.
Column D5:D9999 contains numerical +ve integer.
How to extract last D column digits from column C in column E5:E9999?

Ex:
C5=Peter-0085964 D5=6
E5 should be 085964

C6=Peter-0085964 D6=9
E6=r-0085964

How to accomplish?
 

inspectoRQ

New Member
Joined
Jun 15, 2011
Messages
34
I have value in column C5:C9999. It contains alphanumeric along with special characters.
Column D5:D9999 contains numerical +ve integer.
How to extract last D column digits from column C in column E5:E9999?

Ex:
C5=Peter-0085964 D5=6
E5 should be 085964

C6=Peter-0085964 D6=9
E6=r-0085964

How to accomplish?

=left(find("-")+1,10) 10 is the length of number. if your number`s length is longer, you can write there 100 or more
 

inspectoRQ

New Member
Joined
Jun 15, 2011
Messages
34
I have value in column C5:C9999. It contains alphanumeric along with special characters.
Column D5:D9999 contains numerical +ve integer.
How to extract last D column digits from column C in column E5:E9999?

Ex:
C5=Peter-0085964 D5=6
E5 should be 085964

C6=Peter-0085964 D6=9
E6=r-0085964

How to accomplish?

=MID(c5;FIND("-";c5)+1;10)
 

Haldoug

Board Regular
Joined
Nov 18, 2010
Messages
75
Shweta is correct with =right(c5,d5), but since you have 9999 lines, you may want to do the right bottom of the cell double click trick instead of dragging.
 

inspectoRQ

New Member
Joined
Jun 15, 2011
Messages
34
Shweta is correct with =right(c5,d5), but since you have 9999 lines, you may want to do the right bottom of the cell double click trick instead of dragging.
it is right if length of number constant. but if they are differen for ex. in of them lenght of number 6 and in another 9. there will be wrong result
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
42,230
Office Version
365
Platform
Windows
hsandeep

You seem to have made no comment about the suggestions made by Shweta and Haldoug. Have you tried that method? In what way did it not work?

Aren't these the results you were expecting as described in your first post?

Excel Workbook
CDE
5Peter-00859646
6Peter-00859649
Last Characters
 

Forum statistics

Threads
1,081,748
Messages
5,361,041
Members
400,610
Latest member
ebey

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top