a formula to read first 3 values of a text

Marq

Well-known Member
Joined
Dec 13, 2004
Messages
914
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
I have a spread sheet that i am needing a formula in cell "AE3" in it that executes the following:

Take the first 3 letters of the value of cell "M3" and if those first three letters equal RUP then populate AE3 with "Run Unit Price".....but if the first three letters in M3 equal CTP then populate AE3 with "Center Time Price".....if the first 3 letters don't equal anything in my formula then leave AE3 blank

the values in M3 would look something like this RUP111980

I have only given two acronyms for this example but I will actually need 6 in the total formula....i just need two to get the ball rolling.

Any help would be appreciated
 

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.
How about
=IF(LEFT(M3,3)="RUP","Run unit price",IF(LEFT(M3,3)="CTP","Center Time Price",""))
 
Upvote 0
Another option is to setup a lookup table like


Excel 2013/2016
IJ
8RUPRun unit price
9CTPCenter Time Price
Report


And then use
=IFERROR(INDEX(J8:J9,MATCH(LEFT(M3,3)&"*",I8:I9,0)),"")
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,487
Members
448,967
Latest member
visheshkotha

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