Extract last few digits from a cell

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
959
Office Version
  1. 2007
Platform
  1. Windows
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?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

inspectoRQ

New Member
Joined
Jun 15, 2011
Messages
38
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
38
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

ADVERTISEMENT

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
38
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
 

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
959
Office Version
  1. 2007
Platform
  1. Windows
=left(find("-")+1,10) 10 is the length of number. if your number`s length is longer, you can write there 100 or more

Where to write this formula? There is no C5 & D5!!
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
52,310
Office Version
  1. 365
Platform
  1. 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-00859646085964
6Peter-00859649r-0085964
Last Characters
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,193
Messages
5,768,774
Members
425,492
Latest member
blueexcel123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top