iT邦幫忙

0

Google Sheet Formula(query)

  • 分享至 

  • xImage

各位大神好

想請問如果要在google sheet 的公式裡面做給客戶搜尋的功能的話,
例如:
https://ithelp.ithome.com.tw/upload/images/20210825/20133358KbYL8U9jpS.png

這邊在A:A希望能給客戶搜尋 item以及 更改price的功能
在 M:S欄中顯示在另外一頁中的C,D,F,H,A,B:
但需要特定幾間公司的資訊 ex:prime star,ethirteen,Perigeum

我實在想不到更好的方法所以用下面這個帶入

="SELECT C,D,F,H,A,B WHERE H='" & A1:A & "'"  
& IF(A1<>""," AND F LIKE 'Prime %'","") &IF(A1<>""," OR H='" & A1 & "'","") 
& IF(A1<>""," AND F LIKE 'ethirteen%'","")&IF(A1<>""," OR H='" & A1 & "'","") 
& IF(A1<>""," AND F LIKE 'Perigeum%'","")&IF(A1<>""," OR H='" & A1 & "'","") 

& IF(A2<>""," AND F LIKE 'Prime %'","") &IF(A2<>""," OR H='" & A2 & "'","") 
& IF(A2<>""," AND F LIKE 'ethirteen%'","")&IF(A2<>""," OR H='" & A2 & "'","") 
& IF(A2<>""," AND F LIKE 'Perigeum%'","")&IF(A2<>""," OR H='" & A2 & "'","") 

& IF(A3<>""," AND F LIKE 'Prime %'","") &IF(A3<>""," OR H='" & A3 & "'","") 
& IF(A3<>""," AND F LIKE 'ethirteen%'","")&IF(A3<>""," OR H='" & A3 & "'","") 
& IF(A3<>""," AND F LIKE 'Perigeum%'","")&IF(A3<>""," OR H='" & A3 & "'","") 

將上面這段存到一個儲存格[AD1] 最後在用

=IFERROR(query(get__list!A2:AD, AD1),"")

但今日被通知這個寫法很難看很醜,找了一下想不太到有什麼好方法
希望有沒有大大能幫幫我 萬分感謝

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答