Excel - CUBESETCOUNT Function



CUBESETCOUNT Function

The Excel CUBESETCOUNT function determines the number of elements in a specific set of OLAP cubes. It returns a numeric value counting the number of elements fetched from the CUBESET function. For example, the CUBESET function returns the three electronic devices, Mobile phone, AC, and Laptop, in a set. In this case, the CUBESETCOUNT function will return 3. The CUBERSETCOUNT function comes under the Microsoft Excels CUBE functions category. It is generally used in the stock market, finance reporting, exploration of data, evaluation of Sales production.

Compatibility

This advanced excel function is compatible with the following versions of MS-Excel −

  • Excel for Microsoft 365
  • Excel for Microsoft 365 for Mac
  • Excel for the web
  • Excel 2021
  • Excel 2021 for Mac
  • Excel 2019
  • Excel 2019 for Mac
  • Excel 2016
  • Excel for iPad
  • Excel Web App
  • Excel for iPhone
  • Excel for Android tablets
  • Excel for Android phones

Syntax

The syntax of CUBESETCOUNT function is as follows −

CUBESETCOUNT (set)

Arguments

You can use the following arguments with the CUBESETCOUNT function −

Argument Description Required / Optional
Set A cell reference that points to a cell where the CUBESET function has been evaluated. Required

Points to Remember

  • By default, when you compute the CUBESETCOUNT function, it displays a "#GETTING_DATA" message in the cell before retrieving the actual value.
  • If you specify a cell reference containing an error as an argument in the CUBESETCOUNT function, it will return the same error.

Examples of CUBESETCOUNT Function

Practice the following examples to learn the use of the CUBESETCOUNT function in Excel.

Example 1

Step 1 − First, you must create a sample table in the new Excel worksheet comprising three columns: Region, Full Name, and Total Amount.

Excel CUBESETCOUNT Function 1

Step 2 − After that, you can switch to the Insert tab, expand the PivotTable tile, and select the From Table/Range option from the drop-down list. You can also choose other options like From External Data Source to select the specific dataset outside of Excel.

Excel CUBESETCOUNT Function 2

Step 3 − The other dialog box, PivotTable from table or range, is open. Now, you select the complete range of the dataset or table just adjacent to the Table/Range label. After that, select Existing Worksheet, where PivotTable will be embedded. You may write the specific cell reference adjacent to the Location: label. Moreover, select the checkbox to Add this data to the Data Model. Click on the OK button.

Excel CUBESETCOUNT Function 3

Note − The OLAP tools option is disabled in the Data tab if you do not select the Add this data to the Data Model option, as shown in the above screenshot.

Step 4 − Furthermore, you may individually place the Region and Full Name fields into the Rows area. After that, drag the Total Amount and drop it into the Values area.

Excel CUBESETCOUNT Function 4

Therefore, the Pivot table has been inserted into the desired location.

Excel CUBESETCOUNT Function 5

Note − Before evaluating the CUBESETCOUNT function, you need to compute the CUBESET function, which will retrieve the number of elements in a set. Otherwise, the error may occur.

Step 5 − You may select PivotTable Analyze, expand the OLAP Tools tile, and select the Convert to Formulas option.

Excel CUBESETCOUNT Function 6

In the C11 cell, type the formula = =CUBESET("ThisWorkbookDataModel",(G6,G7),"Flores Tia and Walfers Chris") and hit the Enter.

Excel CUBESETCOUNT Function 7

Therefore, the Flores Tia and Walfers Chris value is returned by the CUBESET function.

Step 6 − In the C13 cell, you may enter the expression =CUBESETCOUNT(G11) and hit the Enter button.

Excel CUBESETCOUNT Function 8

Therefore, 2 is returned by the CUBESETCOUNT function as a result.

Excel CUBESETCOUNT Function 9

Example 2

If you specify a cell reference containing an error as an argument in the CUBESETCOUNT function, it will return the same error.

You enter the formula =CUBESETCOUNT(F12) in the F14 cell. Here, the CUBESETCOUNT argument refers to the cell that contains the #DIV/0! Error.

Excel CUBESETCOUNT Function 10

You may hit the Enter button. Therefore, the CUBESETCOUNT function will return the #DIV/0! Error.

Excel CUBESETCOUNT Function 11

You may edit the value of the F6 cell and re-execute the CUBSET function and CUBESETCOUNT function to get an accurate result.

Advertisements