1 to 3 number digit pull (=left(???))

psrs0810

Well-known Member
Joined
Apr 14, 2009
Messages
1,109
How can I pull a list of numbers that vary from 1 to 3 digits? I was using =left, but kept modifing it for the varying digits

e.g.

I have I need
1-abc 1
23-apple 23
456-tree 456
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Will there always be a dash indicating the end of the number? If so, try:

=LEFT(A1,FIND("-",A1)-1)
 
Upvote 0
How can I pull a list of numbers that vary from 1 to 3 digits? I was using =left, but kept modifing it for the varying digits

e.g.

I have I need
1-abc 1
23-apple 23
456-tree 456

Try...

B2:

Either...

=LEFT(A2,FIND("-",A2&"-")-1)+0

Or...

=IF(A2="","",LEFT(A2,FIND("-",A2&"-")-1)+0)
 
Upvote 0

Forum statistics

Threads
1,224,618
Messages
6,179,917
Members
452,949
Latest member
beartooth91

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