View Single Post
  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Insert a value in a cell based upon a comparison of cell values in 2separate worksheets

I may be missing something, but it looks like you want to match up the value in
F2 to something in column A of the worksheet name salesperson2 and return the
value from column F.

If that's the case, then this would go in K2:
=vlookup(f2,SalesPerson2!$a$2:$F$4000,6,false)

Debra Dalgleish has lots of notes on =vlookup():
http://www.contextures.com/xlFunctions02.html



Doctorjones_md wrote:

What would be the best way to approach this?

I have a hugh list of transactions that I need to sort on -- each
transaction has a Salesperson with falls into (2) distinct Sales Categories:
(Private) & (Commercial).

For reasons beyond my control, the decision was made not to include these
category fields on the worksheets, so I created a listing of all the
Salesperson with their corresponding Sales Categories in a separate
worksheet.

I have the following code -- which does a VLOOKUP on Cell F2
(Salesperson1!F2) against Salesperson2!A2:A4000)
CODE:

=VLOOKUP(F2,Salesperson2!A2:A4000,1,FALSE)

Here's what I'm trying to do ...

I'd like use the values in Salesperson!F2:F4000 and search for these valuse
in Salesperson!A2:A4000 -- for each corresponding MATCH (ie,
Salesperson1!F2 = Salesperson2!A2, insert the value of Salesperson2!B2 into
Salesperson1!K2).

What would be the best way to approach this? I suspect that I'll need to
Loop through records Salesperson1!F2:F4000.

Thanks in advance


--

Dave Peterson