Dynamic Sheet Name in Query in Google Spreashsheet

前端 未结 1 1538
情话喂你
情话喂你 2021-01-20 13:25

In Google spreadsheet I want to query data in another sheet but the problem is that the name of sheet is present in a cell. So is there a way in QUERY function to dynamicall

相关标签:
1条回答
  • 2021-01-20 13:52

    the INDIRECT looks to be the problem. Try like this:

    =query(INDIRECT(A1&"!A5:A10"),"select Col1")
    

    i.e. if Cell A1 contains "food" the above is the same as:

    =query(food!A5:A10,"select A")
    

    and the same as:

    =query(INDIRECT("food!A5:A10"),"select *")
    

    **Note: the indirect uses "Col1" etc and not "A" because it does not pass the col letters.

    Also ... The google groups forum might be a good place to look for spreadsheet formula answers. productforums.google.com/forum/#!categories/docs/spreadsheets

    0 讨论(0)
提交回复
热议问题