Forum Discussion

Jagodragon's avatar
Jagodragon
Iron Contributor
May 20, 2022
Solved

Use SUMIFS on Multiple Columns using BYCOL?

We have a BOM template that needs to accommodate multiple end items. On the Purchased items break down we need to list all purchased items then consolidate the list of purchased items (Rows) and maintain the variable number of end items (Columns)

 

original table of purchased items 

Table1ams 1 qtyasm 2 qtyasm 3 qty...
Purchase Item 1112 
Purchase Item 21 1 

Purchase Item 3

25  
Purchase Item 45 1 
Purchase Item 314  
Purchase Item 2311 
Purchase Item 14 1 

 

Consolidated table

Table2ams 1 qtyasm 2 qtyasm 3 qty...
Purchase Item 1513 
Purchase Item 231

2

 

Purchase Item 3

39  
Purchase Item 45 1 

 

Using a formula to remove duplicates in the Purchase Items column is easy, that's not my issue.

I can use a SUMIFS of each individual column.

 

 

=SUMIFS(INDEX([Table 1 range of all qty values],,1,1),INDEX([Table 1 Purchase Item range],,1),[Table 2 Purchase Item Range])

 

 

My issue is getting the SUMIFS to function on all qty columns with out having to copy paste the formula to each column. I would like for it to do this dynamically.

 

I tried using a BYCOL function with a LAMBDA containing the SUMIFS, but that fails..

 

 

 

=BYCOL((IF([Table 1 Asm list range]>0,1,0)*[Table 1 Asm list range]),LAMBDA(array,SUMIFS(INDEX([Table 1 range of all qty values],,array,1),INDEX([Table 1 Purchase Item range],,1),[Table 2 Purchase Item Range])))

 

 

 

any suggestions?

 

4 Replies

Resources