Match value then return value of cell to left or right

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Match value then return value of cell to left or right



I have a range of cells that have different values. I would like to match values of cell but return the values of cell either to the left or right. For simplicity, let's just say I want the cell 1 column to the left:



enter image description here



Would appreciate any pointers





What about c3, would that not return also?
– Scott Craner
Aug 10 at 17:24





do you want both, or one?
– Scott Craner
Aug 10 at 17:25





Hi there Scott, if you show me how to return 1 column to the left, I can probably figure out from the formula how to do the rest.
– Dergyll
Aug 10 at 17:35





As ComradeMicha mentioned, your table format doesn't make it easy to process without VBA. Could you reformat the table?
– Profex
Aug 10 at 17:44




2 Answers
2



use the following:


=INDEX($A$1:$F$8,INT(AGGREGATE(15,6,(ROW($A$3:$F$8)+(COLUMN($A$3:$F$8)/1000))/($A$3:$F$8=$B$10),ROW(1:1))),INT(AGGREGATE(15,6,(COLUMN($A$3:$F$8)+(ROW($A$3:$F$8)/1000))/(((ROW($A$3:$F$8)+(COLUMN($A$3:$F$8)/1000))=AGGREGATE(15,6,(ROW($A$3:$F$8)+(COLUMN($A$3:$F$8)/1000))/($A$3:$F$8=$B$10),ROW(1:1)))*($A$3:$F$8=$B$10)),1)-1))



enter image description here





..................Very Nice!......................
– Gary's Student
Aug 10 at 17:46





Very smart Mr Craner, thank you very much.
– Dergyll
Aug 10 at 17:51





@Dergyll, but do you actually understand it?
– Profex
Aug 10 at 17:52





@Dergyll See edit, fixed the formula to allow for duplicates in a row.
– Scott Craner
Aug 10 at 17:58





my original sheet was a little more messy, but I used something like this:
– Dergyll
Aug 10 at 18:00



Since VLookup only works if your key is the leftmost item in the range and even then only if the range is a flat table from top to bottom, I think you can only do this using VBA. If your data is always exactly that format, you could also simply hardcode one row at the bottom with a specific cell at the top, if it matches the lookup value write the data, then filter the rows to remove errors/empty cells.



In VBA you just specify the starting point of your lookup data, loop through the cells (either down or to the right, then wrap around when you reach emptyness until you're not finding any more data), compare the cell value to your lookup calue and if it matches, write the data entry at the bottom.





this is more comment than answer. If you wanted to show how this would be done with the existing data setup in vba, then it would be an answer.
– Scott Craner
Aug 10 at 18:10






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard