Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Google Sheets: VLOOKUP based on same-column value of reference sheet?

I’m trying to use vlookup between two tabs in a sheet where the data that exists in a single column denoted by "type" (tab B) needs to be transcribed into separate columns by type (tab A).

Edit:
For example, tab B has the "raw" data listed in just three columns: the type, the ID, and the value.

I would want tab A to be able to pull from tab B but organize it by the ID, then by the value associated with the type following it.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

So, tab A would vlookup according to the ID, and then pull the associated value according to the column name (type): aaaaaa, bbbbbbb, ccccccc

I’ve only done vlookup where the filter is by what exists on tab A to trigger what to pull in tab B

=if((F236="aaa",VLOOKUP(A236, "TabName!$A$4:$AC"),24,FALSE), if(F236="bbb",VLOOKUP(A236,"TabName!"),24,FALSE))

I’ve attached a sample of how the two tabs have been set up for reference! Thank you!

sample sheet

>Solution :

try:

=QUERY('sample database (tab b)'!A2:C, 
 "select B,max(C) 
  where B is not null 
  group by B 
  pivot A 
  label B'ID'")

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading