可以使用 Excel 的公式來實現你所需的流水號格式。假設你要在 A1 單元格輸入品號,B1 單元格輸入日期,C1 單元格自動生成流水號,格式為「年月日+流水號」,例如:20231005-001。以下是具體的步驟:
在 C2 單元格輸入以下公式:
=TEXT(B2, "yyyymmdd") & "-" & TEXT(COUNTIFS(B$2:B2, B2), "000")
當你改變 A 列的品號或 B 列的日期時,C 列的流水號會根據你輸入的日期重新計算,並且會從 1 開始編號。
這樣,你就能夠根據不同的品號和日期自動生成相應的流水號碼。希望這能幫到你!如果有其他問題,隨時告訴我!
How can I modify the Excel formula to ensure that the serial numbers are unique not only by date but also by item number? For instance, if I input the same date for different item numbers, I want the serial numbers to restart from '001' for each new item sprunki phase 3, instead of continuing the count across all items.