Google Sheets search value and return certain columns of multiple rows where the value is present

你说的曾经没有我的故事 提交于 2021-02-08 06:45:29

问题


I'm looking for a formula which can do the following: Lookup a value in column E:I and return all the values from column B:D from the rows it is present. Example: Looking for S190202, it would return B:D from row 2,5,6


回答1:


=QUERY(A1:I, "select B,C,D where E='S190202'
                              or F='S190202'
                              or G='S190202'
                              or H='S190202'
                              or I='S190202'", 1)

for a cell reference, you can change it to:

=QUERY(A1:I, "select B,C,D where E matches '"&K2&"'
                              or F matches '"&K2&"'
                              or G matches '"&K2&"'
                              or H matches '"&K2&"'
                              or I matches '"&K2&"'", 1)

where K2 contains value S190202



来源:https://stackoverflow.com/questions/55119257/google-sheets-search-value-and-return-certain-columns-of-multiple-rows-where-the

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!