将供应预测表的日期与数值填充至项目表的技术需求
Let's walk through how to get this done in Excel (since you referenced cell ranges like A1-C10, I'm assuming that's the tool we're using here). First, let's clarify the setup I'm working with to avoid confusion:
- Your Project Table is in cells A1-C10, with headers
Project,Qty Required,Qty Leftin row 1, and data from rows 2-10. - Your Supply Forecast Table has 10 rows of data, with headers
DateandQty(I'll assume this is in a separate sheet namedSupplyForecast, columns A and B, rows 2-11—adjust references if your setup is different).
Here's how to add and populate the new columns:
1. Add the new columns to your Project Table
First, insert the two required columns right after your existing Qty Left column:
- Click on cell D1, type
Supply Dateand press Enter - Click on cell E1, type
Supply Qty Addedand press Enter
2. Fill the Supply Date column
We'll map the dates from the Supply Forecast to each row in the Project Table. If we're matching by row order (since no explicit matching key was given), use this formula in cell D2, then drag the fill handle down to D10:
=SupplyForecast!A2
If your Supply Forecast is in the same sheet (say, dates are in column F, rows 2-11), adjust the reference to =F2 instead.
For a more dynamic formula that works even if rows are rearranged (using row index), you can use:
=INDEX(SupplyForecast!$A$2:$A$11,ROW()-1)
3. Fill the Supply Qty Added column
Same logic applies for the quantity data. In cell E2, enter this formula and drag down to E10:
=SupplyForecast!B2
Or the dynamic INDEX version:
=INDEX(SupplyForecast!$B$2:$B$11,ROW()-1)
Notes if you need a different matching logic
If you actually need to match based on a shared key (like a project ID that exists in both tables), just let me know! We can switch to using XLOOKUP (for Excel 365/2021) or VLOOKUP to pull the correct supply data for each project, instead of row-based mapping.
内容的提问来源于stack exchange,提问作者GenXeral

