Jump to content

Recommended Posts

Posted

I couldn't find the existing Excel Help topic so created this one.I think I need a v lookup or if/then type statement I believe? I have one spreadsheet that is constant and has a CustomerID and AccountRep. I have a second spreadsheet that is variable and updated weekly with customer revenue by that same CustomerID in the first spreadsheet. So the 2nd sheet has CustomerID and Revenue and I want to add a 3rd column that automatically reads the first spreadsheet and when it finds the CustomerID it matches and posts the corresponding AccountRep into the 3rd column of the 2nd sheet. Hope that makes sense. I screen capped a fake example to help illustrate: http://vvcap.net/db/...HMt5E6x1rvK.pngThere are about 1,000 customer IDs and only 4 reps if that matters

Posted

Yeah, vlookup would work.Using your examples (and assuming the first spreadsheet was called "database"), it would look like this:=VLOOKUP(A2,[database.xls]Sheet1!$A$2:$B$5,2,FALSE)

Posted

I'm doing something wrong, I have these in Sheet 1 and Sheet 2 now:Sheet 1 is the master file:http://vvcap.net/db/...CSBOdN2ut47.pngSheet 2 is where I'm putting the VLOOKUP to fill in the AccountRephttp://vvcap.net/db/...HDBJnxtgNUg.pngIt appears to just be putting the accountrep in the same order as on sheet 1 versus actually looking for the customerid and matching the correct accountrep?EDITOooops, here is the code I'm using as wellhttp://vvcap.net/db/XjzG1jXIHApK42fbFxay.png

Posted
EDITOooops, here is the code I'm using as wellhttp://vvcap.net/db/...ApK42fbFxay.png
You're missing the first cell reference that you're looking up.You have: =vlookup(Sheet1...Should be: =vlookup(A2,Sheet1...Edit: Oh, I see, you're not missing the reference, you just have two Sheet1's. My fix still works though.
Posted

Should I sort the master Sheet 1 list Alphabetically or something? Been reading some stuff that says to do that?actually, in this example the customerid is alphabetical on sheet 1, just not sheet 2

Posted
ok closer, it worked for 3 of the 4. Any idea why ABC would say N/A ?http://vvcap.net/db/...Cx88YoIOmJP.png
Yes. When you entered the part where it says "A2:B5" and copied the formula down, it moved that part down too.Change the first formula to $A$2:$B$5 and then copy it down.Edit: Well then. And it doesn't matter if you sort alphabetically.
Posted
thanks for the help, working like a charm
Some day, and that day may never come, I will call upon you to do a service for me.
Posted

the reference to sheet 1 can be A:B if no other data is below it. saves some $.I had a problem in here but the formatting went idiotic when I hit submit and I can't be arsed to make images for it in imgur.

Posted
the reference to sheet 1 can be A:B if no other data is below it. saves some $.
Good suggestion.It also saves a lot of head-scratching when you add values to the bottom of the list and some of the lookups don't work like you expect.
Posted

I try to avoid ever using absolute vlookup references for that reason. the workaround, if you have to use absolute, is to insert cells in the range when you want to add more vlookup values. excel will adjust the formulas where you're doing the vlookup to include the new inserted cells. but it's a total pain compared to just click-shift-click on column headers. you probably knew this though.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...