﻿ Create a Crosstab Report with Three Simple Dynamic Array Formulas | Spread # Create a Crosstab Report with Three Simple Dynamic Array Formulas

Using Spread.NET 13 and the Dynamic Array support, it's easy to create a powerful crosstab report with three simple formulas.

This example uses the following table CrossTabData for sample data: The first formula creates the horizontal labels across the top of the report showing a unique list of values in the Product column: =TRANSPOSE(SORT(UNIQUE(CrossTabData[Product])))

The formula above in cell I8 creates a sorted list of the unique values from the Product column, then uses the TRANSPOSE function to make the resulting array spill to the right to the cell K8.

The second formula creates the vertical labels down the left side of the report showing a unique list of values in the Product Line column: =SORT(UNIQUE(CrossTabData[Product Line])))

That formula is like the previous one, except that TRANSPOSE isn't needed and the values come from the Product Line column instead of the Product column.

The third and final formula creates the crosstab report data in the cell range I9:K10: =SUMIFS(CrossTabData[Total],CrossTabData[Product Line],H9#,CrossTabData[Product],I8#)

That formula uses two dynamic array arguments, one vertical (H9#) and one horizontal (I8#), with the SUMIFS function. Normally those function arguments for SUMIFS are scalar values, so the array values cause the calculation engine to "lift" the calculation and calculate SUMIFS for each pair of values and return the result in a dynamic array, which spills in the range I9:K10.
{"ft_lang_label":"__label__en","ft_lang_prob":0.6706198,"math_prob":0.8991051,"size":1528,"snap":"2022-27-2022-33","text_gpt3_token_len":339,"char_repetition_ratio":0.14304462,"word_repetition_ratio":0.07017544,"special_character_ratio":0.20287958,"punctuation_ratio":0.08695652,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9802962,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12],"im_url_duplicate_count":[null,null,null,4,null,4,null,4,null,4,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-07-07T06:42:52Z\",\"WARC-Record-ID\":\"<urn:uuid:1f574534-f3bd-43ea-b713-32784db664ec>\",\"Content-Length\":\"34104\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:3505d260-c842-4af4-8ca8-ca9a8fbb8b6b>\",\"WARC-Concurrent-To\":\"<urn:uuid:4011157e-c6d3-43d5-9e61-9d018ed7d31b>\",\"WARC-IP-Address\":\"20.36.236.120\",\"WARC-Target-URI\":\"https://www.grapecity.com/blogs/create-crosstab-reports-with-three-simple-dynamic-array-formulas\",\"WARC-Payload-Digest\":\"sha1:OMII4WYLCKA6H2AMMARNUWMV2QX5HIKM\",\"WARC-Block-Digest\":\"sha1:TL6LV5Y3B5LGSPY5TUYFYVRIQBA4XOVB\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-27/CC-MAIN-2022-27_segments_1656104683708.93_warc_CC-MAIN-20220707063442-20220707093442-00276.warc.gz\"}"}