Created
April 20, 2022 22:35
-
-
Save RecalcOrDie/467a4f70d01a01cf1183f99dc0abc172 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Name: PIVOTTABLE | |
Description: LAMBDA used to make a pivot table formula | |
Author: Karina Adcock | |
Category: Dynamic Arrays | |
URL video: https://www.youtube.com/watch?v=VoB_cigX1hk | |
*/ | |
PIVOTTABLE = LAMBDA( | |
data, | |
LET( one, TAKE( data, , 1 ), | |
two, INDEX( data, , 2 ), | |
three, DROP( data, , 2 ), | |
group1, SORT( UNIQUE( one ) ), | |
group2, TRANSPOSE( SORT( UNIQUE( two ) ) ), | |
VSTACK( | |
HSTACK( "", group2, "Total" ), | |
HSTACK( group1, | |
SUMIFS( three, | |
one, group1, | |
two, group2 ), | |
SUMIFS( three, one, group1 ) ), | |
HSTACK( "Total", | |
SUMIFS( three, two, group2 ), | |
SUM( three ) | |
) | |
) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment