# Extract last few digits from a cell

#### hsandeep

##### Well-known Member
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.

#### Shweta

##### Well-known Member
Try this

=RIGHT(C1,D1) & drag it down.

#### inspectoRQ

##### New Member
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
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

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

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

This didnot WORK.

#### hsandeep

##### Well-known Member
=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
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

#### inspectoRQ

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

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

Replies
17
Views
382
Replies
6
Views
184
Replies
16
Views
1K
Replies
5
Views
171
Replies
6
Views
190

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.

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.

### Which adblocker are you using?

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

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