Can XLookUp sum also?

Jazz Engineer

New Member
Joined
Feb 1, 2022
Messages
15
Office Version
  1. 365
Platform
  1. Windows
I purchased a Kindle copy of Bill Jelen's Excel 2021 Inside Out. Chapter 9 discusses how, thanks to Dynamic Arrays, a single XLookUp formula can return multiple values. The example used on page 229 is what I want to discuss. At first this seems like a cool idea. But that's because the Inventory By Month range is not sorted by Item ID. If you sort the range on that field, you'll find that, in many instances, there is more than one occurrence of an ID. It seems to me that the destination range, A4:N12, is intended to sum the monthly inventory of each item ID. This formula does NOT do that.

My question is: Could a single formula be written that locates all occurrences of each Item ID and sums the inventory values per month.

The formula looks like this: =XLOOKUP(B6,$B$19:$B$14058,$C$19:$N$14058).

If you assign names to the ranges, it looks like this: =XLOOKUP(B5,InventoryID,MonthlyInventory)

My PC kept hanging when I installed XL2BB. When I tried SnagIt, the file, though only about 15 rows plus the formula bar, was too big.

Thanks,

Steve / JazzEngineer
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
what about
=SUMPRODUCT(($B$19:$B$14058=B6)*($C$19:$N$14058))

Book7
ABCDEF
1
2
335
4
5
6a
7
8
9
10
11
12
13
14
15
16
17
18
19a212
20
21
22a6
23
24
25a114
26
Sheet1
Cell Formulas
RangeFormula
E3E3=SUMPRODUCT((B19:B27=B6)*(C19:E27))
 
Upvote 0
Solution
what about
=SUMPRODUCT(($B$19:$B$14058=B6)*($C$19:$N$14058))

Book7
ABCDEF
1
2
335
4
5
6a
7
8
9
10
11
12
13
14
15
16
17
18
19a212
20
21
22a6
23
24
25a114
26
Sheet1
Cell Formulas
RangeFormula
E3E3=SUMPRODUCT((B19:B27=B6)*(C19:E27))
That seems like it might work. I'll have to study SumProduct to understand it and work out a solution in the original data file. But I guess that, as long as I had a single column of unique Item IDs, each row's formula would adjust and calculate the results. I'll get back to you.

Steve
 
Upvote 0
That seems like it might work. I'll have to study SumProduct to understand it and work out a solution in the original data file. But I guess that, as long as I had a single column of unique Item IDs, each row's formula would adjust and calculate the results. I'll get back to you.

Steve
Etaf,

Both of your formulae worked! Thanks.
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,734
Members
449,094
Latest member
dsharae57

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top