Reduce with #VALUE! error message

tana

New Member
Joined
Jan 22, 2021
Messages
32
Office Version
  1. 365
Platform
  1. Windows
Hi,

May I have your help on my attached excel question?

I have data in monthly columns and would like to summarize them in yearly with spilled array. Thanks


Reduce.gif
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
MMULT does not work with blank data cells. You can double-negative (--) the data range to convert blanks to zeros. Also, REDUCE is not needed here. MMULT can get it in one go. For example:

Excel Formula:
=LET(
    year, TOCOL(YEAR(A1:X1)),
    years, A11#,
    data, A2:X8,
    MMULT( --data,--(year=years))
)

Or just...

Excel Formula:
=MMULT(--A2:X8,--(TOCOL(YEAR(A1:X1))=A11#))

Cheers!
 
Upvote 0
Solution
Wow, you are amazing!!! It works.

May I ask you one more question? I understood the first double-negative which converts the blank cell data (A6 to L7) to zero. Then what about the second double-negative? Thanks,
 
Upvote 0
May I ask you one more question? I understood the first double-negative which converts the blank cell data (A6 to L7) to zero. Then what about the second double-negative? Thanks,
You're welcome. The second double-negative converts TRUE/FALSE values to 1/0. MMULT doesn't do that conversion on its own when multiplying array1 with array2.
 
Upvote 0
Thanks so much for your help! You have a nice weekend!
 
Upvote 0
If you have the new GROUPBY function another option might be this (It includes the year headings so they do not need to be generated separately)

24 10 13.xlsm
ABCDEFGHIJKLMNOPQRSTUVWX
1Jan-25Feb-25Mar-25Apr-25May-25Jun-25Jul-25Aug-25Sep-25Oct-25Nov-25Dec-25Jan-26Feb-26Mar-26Apr-26May-26Jun-26Jul-26Aug-26Sep-26Oct-26Nov-26Dec-26
2494636785121549259134865
3385974387938299697715511
4312633357487877298264498
5785888562645315198447728
6287712541284
7544845581811
8495768953877945839992992
9
10
1120252026
125661
137462
145274
157259
16051
17054
187878
tana
Cell Formulas
RangeFormula
A11:B18A11=TRANSPOSE(GROUPBY(TRANSPOSE(YEAR(A1:X1)),TRANSPOSE(A2:X8),SUM,,0))
Dynamic array formulas.
 
Last edited:
Upvote 0
Unfortunately, my version of Excel does not have GroupBy yet.
 
Upvote 0
Unfortunately, my version of Excel does not have GroupBy yet.
Fair enough.
I was under the impression that it was gradually being rolled out to all 365 subscribers and there is nothing in the GROUPBY Help to indicate any restrictions but I did see something recently that at the moment it may only be available within the Insiders program. Hopefully it will be available to all 365 users before long. 🤞
 
Upvote 0
Upvote 0
Hello, here is some information on GROUPBY and PIVOTBY release posted by @Alex Blakenburg within a different thread.
Thanks for the additional info.

@tana
I don't know what Channel you are on but might be worth checking in File -> Account -> Update Options to see if there are any updates waiting for you.
 
Upvote 0

Forum statistics

Threads
1,223,532
Messages
6,172,875
Members
452,486
Latest member
standw01

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