Good day to all,
I' ve been scouring the Internet for a way to get vlookup to return not just the first value meeting the criteria but all of them but so far no luck.
PR1 100
PR2 300
PR3 500
PR4 700
PR1 200
PR4 800
PR3 600
PR2 400
PR1 Mutiple Values
To make my question clearer, lets say we have the above data in columns A and B. The lookup table is A1:B8 and the lookup value is in cell A10. Is there a way to get vlookup to return all the values from column B, matching the criteria (i.e. the lookup value in cell A10) and show the results in concatenated form in cell B10; In this simple example it should return 100,200.
I know this could be done using VBscript but I wonder if there is an easier way, using the available functions in Excel 2007.
I thought of one way it could be done but don't know how to express it in Excel language.
1. count the number of rows in the lookup range.
2. find the row number of the first occurence.
3. display the first occurence
4. search for the next occurence in a new range, defined as (A1+(row number of the first occurrence)):B8. For example if the first occurence was found in row 3, the new range would be defined as (A1+3:B8), i.e. A4:B8.
5. Repeat the process until we get the last value.
Any help would be greatly appreciated!!!
I' ve been scouring the Internet for a way to get vlookup to return not just the first value meeting the criteria but all of them but so far no luck.
PR1 100
PR2 300
PR3 500
PR4 700
PR1 200
PR4 800
PR3 600
PR2 400
PR1 Mutiple Values
To make my question clearer, lets say we have the above data in columns A and B. The lookup table is A1:B8 and the lookup value is in cell A10. Is there a way to get vlookup to return all the values from column B, matching the criteria (i.e. the lookup value in cell A10) and show the results in concatenated form in cell B10; In this simple example it should return 100,200.
I know this could be done using VBscript but I wonder if there is an easier way, using the available functions in Excel 2007.
I thought of one way it could be done but don't know how to express it in Excel language.
1. count the number of rows in the lookup range.
2. find the row number of the first occurence.
3. display the first occurence
4. search for the next occurence in a new range, defined as (A1+(row number of the first occurrence)):B8. For example if the first occurence was found in row 3, the new range would be defined as (A1+3:B8), i.e. A4:B8.
5. Repeat the process until we get the last value.
Any help would be greatly appreciated!!!