想詢問大大,我要怎麼在B欄位回寫數值
如圖:
A1是標題,A2-A4內有一欄有guid,故B1欄位回寫數值1
A5是標題,A6-A10內有兩欄有guid,故B5欄位回寫數值2
A11是標題,A12-A14無guid,故B11欄位回寫數值0
.....以此類推
B1:
=IF(RIGHT(A1,4)="2022",(LEN(TEXTJOIN(,,OFFSET(A1,1,0,IF(ISNA(MATCH("2022",RIGHT(A2:A21,4),0)),COUNTA(A2:A21),MATCH("2022",RIGHT(A2:A21,4),0)),1)))-LEN(SUBSTITUTE(TEXTJOIN(,,OFFSET(A1,1,0,IF(ISNA(MATCH("2022",RIGHT(A2:A21,4),0)),COUNTA(A2:A21),MATCH("2022",RIGHT(A2:A21,4),0)),1)),"GUID","")))/4,"")
再下複製公式到B2:B21儲存格。
要2019版本才可以。
將提供範例,以2010作為關鍵字,算有id的儲存格數量。
b2:
=IF(RIGHT(A2,4)="2010",(LEN(TEXTJOIN(,,OFFSET(A2,1,0,IF(ISNA(MATCH("2010",RIGHT(A3:A42,4),0)),COUNTA(A3:A42),MATCH("2010",RIGHT(A3:A42,4),0)),1)))-LEN(SUBSTITUTE(TEXTJOIN(,,OFFSET(A2,1,0,IF(ISNA(MATCH("2010",RIGHT(A3:A42,4),0)),COUNTA(A3:A42),MATCH("2010",RIGHT(A3:A42,4),0)),1)),"id","")))/2,"")
再下複製公式到B3:B42儲存格。
有了~大感謝