简体   繁体   中英

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.

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

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'")

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM