使用 google sheet 公式获取具有数量的单元格的 table headers 并显示在账单中
Get the table headers of the cells having quantities and display in bill using google sheet formula
我有一个 google spreadsheet,我需要从相关客户那里获取数量和订购的水果。 headers 预计将根据所选择的账单编号(红色单元格)提取并放置在(黄色单元格)中。
我已经尝试使用 vlookup 来获取数量并找到总价,效果很好。
下面的截图是
例如选择5号账单,Matt会显示在账单中,使用vlookup,显示Apple Banana和Mango根据公式显示
When bill number 2 is choosen Cathy will be displayed and in yellow cells only Banana and Mango will be displayed (apple and pineapple should not be displayed as Cathy didnt purchase them)
这里是 Google sheet: https://docs.google.com/spreadsheets/d/1n2XgoUHZh9GwWGTQP8nvK2MV3uoXzP7s9V7aXLMbOrk/edit#gid=1150750443
使用:
=ARRAYFORMULA(TRIM(SPLIT(QUERY(FLATTEN(TRIM(
IF((A2:A7=B11)*(D2:G7<>""),D1:G1&" ♦ ♠ ♦"&D2:G7, ))),
"where Col1 is not null"), "♦♠")))
我有一个 google spreadsheet,我需要从相关客户那里获取数量和订购的水果。 headers 预计将根据所选择的账单编号(红色单元格)提取并放置在(黄色单元格)中。
我已经尝试使用 vlookup 来获取数量并找到总价,效果很好。
下面的截图是
例如选择5号账单,Matt会显示在账单中,使用vlookup,显示Apple Banana和Mango根据公式显示
When bill number 2 is choosen Cathy will be displayed and in yellow cells only Banana and Mango will be displayed (apple and pineapple should not be displayed as Cathy didnt purchase them)
这里是 Google sheet: https://docs.google.com/spreadsheets/d/1n2XgoUHZh9GwWGTQP8nvK2MV3uoXzP7s9V7aXLMbOrk/edit#gid=1150750443
使用:
=ARRAYFORMULA(TRIM(SPLIT(QUERY(FLATTEN(TRIM(
IF((A2:A7=B11)*(D2:G7<>""),D1:G1&" ♦ ♠ ♦"&D2:G7, ))),
"where Col1 is not null"), "♦♠")))