Conditional vlookups?

L

Legacy 262721

Guest
Hi.
I'm trying to process Customer History data in a spreadsheet for importing into another program, but the problem is that I have the same customers appearing in multiple rows if we've serviced them more than once. What I need is to have a single row for each customer, with their data for 2010, 2011, 2012 and 2013 contained within that single row.
I've tried using IFs and VLOOKUPs, but I only get the first instance of the customer appearing in the result, not the entry appropriate to the year of the column. I've been reading about array formulas, but the explanations are as baffling as the formulas themselves. Can anybody advise?

This is what I have:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Customer[/TD]
[TD]Job Number[/TD]
[TD]Job Date[/TD]
[TD]Invoice Date[/TD]
[/TR]
[TR]
[TD]Geoff[/TD]
[TD]100[/TD]
[TD]01/01/10[/TD]
[TD]02/01/10[/TD]
[/TR]
[TR]
[TD]Geoff[/TD]
[TD]103[/TD]
[TD]01/01/11[/TD]
[TD]02/01/11[/TD]
[/TR]
[TR]
[TD]Tim[/TD]
[TD]102[/TD]
[TD]02/02/10[/TD]
[TD]03/02/10[/TD]
[/TR]
[TR]
[TD]Tim[/TD]
[TD]104[/TD]
[TD]03/03/11[/TD]
[TD]04/03/11[/TD]
[/TR]
</tbody>[/TABLE]

This is what I need:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Customer[/TD]
[TD]2010 Job number[/TD]
[TD]2010 Job date[/TD]
[TD]2010 Invoice date[/TD]
[TD]2011 Job Number[/TD]
[TD]2011 Job Date[/TD]
[TD]2011 Invoice date[/TD]
[/TR]
[TR]
[TD]Geoff[/TD]
[TD]100[/TD]
[TD]01/01/10[/TD]
[TD]02/01/10[/TD]
[TD]103[/TD]
[TD]01/01/11[/TD]
[TD]02/01/11[/TD]
[/TR]
[TR]
[TD]Tim[/TD]
[TD]102[/TD]
[TD]02/02/10[/TD]
[TD]03/02/10[/TD]
[TD]104[/TD]
[TD]03/03/11[/TD]
[TD]04/03/11[/TD]
[/TR]
</tbody>[/TABLE]

I'd do it manually, but there are over 3,000 entries and it would take a far too long. Any help would be appreciated.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hello, I use the formula =IF($A:$A="","",VLOOKUP($A:$A,$Z$1:$AJ$80,2,FALSE)) for something similar. $A:$A would be the coulmn with the persons name. $Z$1:$AJ:80 is the table with all the info, you will need to change this to the cells you store the information. 2 would return the info in column 2 of your table, in your example this would be Job number.

So if in one cloumn you have a 2 to result in job number in the next you would use 3 to return the job date, 4 to return invoice date.

*In cell G2 you use =IF($A:$A="","",VLOOKUP($A:$A,$Z$1:$AJ$80,3,FALSE))
*in Cell G3 you use =IF($A:$A="","",VLOOKUP($A:$A,$Z$1:$AJ$80,4,FALSE))
*in Cell G4 you use =IF($A:$A="","",VLOOKUP($A:$A,$Z$1:$AJ$80,5,FALSE))

*The IF statement just keeps the cell blank if noting is entered.
 
Last edited:
Upvote 0
That's great, thanks, much closer, so close I can almost taste it... BUT!

...I'm still getting only the first result the vlookup finds in the column, and not the date-appropriate result. I know you can constrain formulas according to the cell containing a certain date using an ISNUMBER(SEARCH formula, but I can't find where to insert that in your formula.

Any ideas?
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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