SOLVED

Fetch a varying number of records based on criteria, and create table

%3CLINGO-SUB%20id%3D%22lingo-sub-2549061%22%20slang%3D%22en-US%22%3EFetch%20a%20varying%20number%20of%20records%20based%20on%20criteria%2C%20and%20create%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2549061%22%20slang%3D%22en-US%22%3E%3CP%3EI%20would%20like%20a%20sheet%20where%20the%20user%20fills%20in%20a%20supplier%2C%20let's%20say%20in%20C3.%20Based%20on%20this%20input%2C%20a%20column%20of%20products%20is%20fetched%20from%20a%20table%20in%20another%20sheet%26nbsp%3B%20(Suppliers%20%2B%20Products).%20The%20number%20of%20products%20varies%20according%20to%20the%20supplier.%3C%2FP%3E%3CP%3EThe%20user%20can%20then%20fill%20in%20quantities%20next%20to%20the%20products%2C%20and%20a%20calculation%20is%20made.%3C%2FP%3E%3CP%3EWhen%20the%20user%20fills%20in%20another%20supplier%2C%20the%20column%20with%20products%20changes%20accordingly.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22bartvana_2-1626291923478.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F295903iF0E19CAC1B5E147E%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22bartvana_2-1626291923478.png%22%20alt%3D%22bartvana_2-1626291923478.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22bartvana_3-1626291955016.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F295904i93C28D34C9960F82%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22bartvana_3-1626291955016.png%22%20alt%3D%22bartvana_3-1626291955016.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20are%20the%20different%20strategies%20for%20creating%20the%20column%20with%20products%3F%26nbsp%3BSee%20the%20simplified%20workbook%20attached.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E(I%20can%20do%20this%20with%20Power%20Query%2C%20but%20there%20I%20have%20the%20problem%20that%20upon%20refresh%20the%20references%20are%20lost%20in%20the%20formula%2C%20see%20this%20post%20%22%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fexcel%2Fref-error-after-power-query-refresh%2Fm-p%2F2548444%22%20target%3D%22_self%22%3E%23REF%20error%20after%20Power%20Query%20refresh%3C%2FA%3E%22.%20So%20I'm%20interested%20in%20other%20ways%20to%20realize%20the%20same.)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2549061%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2549377%22%20slang%3D%22en-US%22%3ERe%3A%20Fetch%20a%20varying%20number%20of%20records%20based%20on%20criteria%2C%20and%20create%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2549377%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F863782%22%20target%3D%22_blank%22%3E%40bartvana%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20have%20Excel%20in%20Microsoft%20365%2C%20you%20can%20use%20the%20FILTER%20function.%3C%2FP%3E%0A%3CP%3EThe%20attached%20version%20contains%20an%20array%20formula%20that%20will%20work%20in%20all%20versions%20of%20Excel.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2550683%22%20slang%3D%22en-US%22%3ERe%3A%20Fetch%20a%20varying%20number%20of%20records%20based%20on%20criteria%2C%20and%20create%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2550683%22%20slang%3D%22en-US%22%3EOK%2C%20thank%20you!%3C%2FLINGO-BODY%3E
Contributor

I would like a sheet where the user fills in a supplier, let's say in C3. Based on this input, a column of products is fetched from a table in another sheet  (Suppliers + Products). The number of products varies according to the supplier.

The user can then fill in quantities next to the products, and a calculation is made.

When the user fills in another supplier, the column with products changes accordingly.

bartvana_2-1626291923478.png

bartvana_3-1626291955016.png

 

What are the different strategies for creating the column with products? See the simplified workbook attached.

 

(I can do this with Power Query, but there I have the problem that upon refresh the references are lost in the formula, see this post "#REF error after Power Query refresh". So I'm interested in other ways to realize the same.)

2 Replies
best response confirmed by bartvana (Contributor)
Solution

@bartvana 

If you have Excel in Microsoft 365, you can use the FILTER function.

The attached version contains an array formula that will work in all versions of Excel.