Can I combine 2 formulas?

D

dp

With Col A&B blank, I have the following in column C
AL FEE
AM SERVICE
B SERVICE
C SERVICE

I need to use the letter(s) preceeding fee/service in a vlookup formula
So my formula in cell a2 =trim(left(c2,2)) will give me just the letter(s)

The array for lookup is in cells F2:G63
So my formula in cell b2 =vlookup(a2,$F$2:$G$63,2,false)

I wind up with this:
ColA ColB ColC
AL 6 AL Fee
AM 6 AM Service
B 1 B Service
C 2 C Service

Can I combine these two formulas in one cell so it will find the letter(s),
then lookup the code? I later use the numeric codes to sort and get
subtotals.
Hope this make sense.
dp
 
D

dp

Thanks for your reply - I'm getting #N/A
dp

Don Guillett said:
try
=vlookup(left(trim(c2),2),$F$2:$G$63,2,0)


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
 
D

dp

Correction
I copied the formula down some rows (past the #N/A) and only the rows with 2
letters are ok.
The rows with one letter have a space or two after if that makes a difference.
 
D

dp

Your email solution
=VLOOKUP(LEFT(TRIM(C2),FIND(" ",C2)-1),$F$2:$G$63,2,0) works great.
Thanks again for your time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top