Lookup and Vlookup
I have a spreadsheet with 2 tabs. first has all contact details for my
customers with name, address and so on in a single row. i also have a
several columns which tells me the group they belong to with a yes
against their row.
I want to be able to use the tab 2 to pull out the customers who belong
to specific groups.
for eg: if Mr Smith has a yes against their group RAC, i want him to
appear on the second tab of my spreadsheet.
each month the groups will change so instead of copying and pasting i
want to use a system where it should automatically update the second tab
accordingly.
In my example, the group names start in Sheet1!M1 and extend to the right. Customer names start in Sheet1!A2 and extend downward.
The desired result is in Sheet3.
Sheet2 holds intermediate calculations.
In Sheet2!A1, put
=IF(Sheet1!M1="","",Sheet1!M1)
and copy rightward as far as could be needed.
Do the same in Sheet3.
In Sheet2!A2 put
=IF(Sheet1!M2="yes",MAX(A$1:A1)+1,"")
and copy rightward and downward as far as could be needed.
In Sheet3!A2 put
=IF(ROW()-1MAX(Sheet2!A:A),"",
OFFSET(Sheet1!$A$1,MATCH(ROW()-1,Sheet2!A:A,0)-1,0))
and copy rightward and downward as far as could be needed.
|