Extract last few digits from a cell

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,226
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
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?
 
This didnot WORK.

As commas, not semicolons are needed to identify different arguments of a formula, inspectoRQ's formula therefore won't work as posted.
 
Upvote 0
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?

Last Characters

CDE
Peter-0085964
Peter-0085964

<COLGROUP><COL style="WIDTH: 30px; FONT-WEIGHT: bold"><COL style="WIDTH: 119px"><COL style="WIDTH: 39px"><COL style="WIDTH: 91px"></COLGROUP><TBODY>
[TD="bgcolor: #cacaca, align: center"]5[/TD]

[TD="align: center"]6[/TD]
[TD="align: center"]085964[/TD]

[TD="bgcolor: #cacaca, align: center"]6[/TD]

[TD="align: center"]9[/TD]
[TD="align: center"]r-0085964[/TD]

</TBODY>

Spreadsheet Formulas
CellFormula
E5=RIGHT(C5,D5)
E6=RIGHT(C6,D6)

<TBODY>
</TBODY>

<TBODY>
</TBODY>


Excel tables to the web >> Excel Jeanie HTML 4

Shweta's formula WORKS.
 
Upvote 0
Where to punch this formula? because there is no D column....
I don't think that formula is aimed at your solution. It extracts what is the the right of the "-", not the number of characters shown in column D as your original post requested. If Shweta's formula works, which I believe it does, then just use that. :)
 
Upvote 0
I don't think that formula is aimed at your solution. It extracts what is the the right of the "-", not the number of characters shown in column D as your original post requested. If Shweta's formula works, which I believe it does, then just use that. :)

that formula find "-" and get the character righside, =right formula wont work if length of characters are different at rightside
 
Upvote 0
that formula find "-" and get the character righside, ...
Yes, but the OP doesn't just want the characters to the right of the "-", they want the number of characters specified in column D. Look especially at the expected result for the second example that was given.

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

C6=Peter-0085964 D6=9
E6=r-0085964
How to accomplish?
 
Upvote 0
As commas, not semicolons are needed to identify different arguments of a formula, inspectoRQ's formula therefore won't work as posted.

This depends on what country you are at. The Brazilian version of Excel uses semicolons as separators for formula arguments... :lookaway:
 
Upvote 0
This depends on what country you are at. The Brazilian version of Excel uses semicolons as separators for formula arguments

Thanks Worf - learnt something new today ;)
 
Upvote 0

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