PleaseHelp2
New Member
- Joined
- Jul 1, 2011
- Messages
- 2
Please Help!!
I am trying to do a vlookup into an array that has multiple instances of the value that I am looking up.
The value that I am looking up is an input variable (based on a list), so the number of times the value appears in the array will vary based on the input variable.
I want to return the data for all instances on seperate lines.
I've done a countif to determine the number of times the value is in the array. For example, the countif returned 3 so I know that there are 3 instances of this this input variable in the array, therefore I want to return 3 new values on 3 lines.
[=COUNTIF('Sheet1'!B7:B51,A7)]
I've done a match to determine where the 1st instance of the value is. For example, match returned 34, so for this input variable, I know the data starts on row 34 of the array.
(I've sorted the array that I'm looking up into to ensure that it is sorted so I know that I want to pull rows 34, 35, and 36)
[=MATCH(A7,'Sheet1'!B7:B51,0)]
The countif and match are looking at the same sheet.
So essentially I want my vlookup for the first line to be B34:E51, for the next line to be B35:E51 and the third line, B36:E51.
Is there a way to populate the cells based on the information I have?
Should I be approaching this differently? I'm trying to do it with a complex formula, but should I be writing a macro?
Any thoughts or ideas are appreciated!
Thanks!
I am trying to do a vlookup into an array that has multiple instances of the value that I am looking up.
The value that I am looking up is an input variable (based on a list), so the number of times the value appears in the array will vary based on the input variable.
I want to return the data for all instances on seperate lines.
I've done a countif to determine the number of times the value is in the array. For example, the countif returned 3 so I know that there are 3 instances of this this input variable in the array, therefore I want to return 3 new values on 3 lines.
[=COUNTIF('Sheet1'!B7:B51,A7)]
I've done a match to determine where the 1st instance of the value is. For example, match returned 34, so for this input variable, I know the data starts on row 34 of the array.
(I've sorted the array that I'm looking up into to ensure that it is sorted so I know that I want to pull rows 34, 35, and 36)
[=MATCH(A7,'Sheet1'!B7:B51,0)]
The countif and match are looking at the same sheet.
So essentially I want my vlookup for the first line to be B34:E51, for the next line to be B35:E51 and the third line, B36:E51.
Is there a way to populate the cells based on the information I have?
Should I be approaching this differently? I'm trying to do it with a complex formula, but should I be writing a macro?
Any thoughts or ideas are appreciated!
Thanks!