DEV Community

Andrews
Andrews

Posted on • Originally published at geekexcel.com on

Excel Formulas to use COUNTIFS with variable table column!!

We know that the COUNTIFS function in Excel can count on multiple criteria. It takes arguments as a couple of criteria, range, and criteria. Here, I will introduce you to some easy formulas to use COUNTIFS with the variable table column in Excel. Let’s get started!! Get an official version of ** MS Excel** from the following link: https://www.microsoft.com/en-in/microsoft-365/excel

Generic Formula

  • You can use the below formula to COUNTIFS with the variable table column in Excel.
=COUNTIFS([INDEX](https://geekexcel.com/index-function-in-microsoft-excel-365-how-to-use/)(Table,0,[MATCH](https://geekexcel.com/how-to-use-match-function-in-microsoft-excel-365/)(name,Table[#Headers],0)),criteria))

Enter fullscreen mode Exit fullscreen mode

Syntax Explanation

  • INDEX ** – The **INDEX function returns the value at a given position in a range or array. INDEX is frequently used together with the MATCH function.
  • Parenthesis () – The main purpose of this symbol is to group the elements.
  • COUNTIFS – This function helps to create a cell address from a given row and column.
  • Comma symbol (,) – It is a separator that helps to separate a list of values.
  • MATCH ** – The **MATCH function helps to locate the position of a lookup value in a row, column, or table.
  • *Table * – It contains list of values.

Practical Example

Let’s consider the below example image.

  • Firstly, you need to create a sample data in Excel.

Sample data

  • To use COUNTIFS with a variable table column for swim , you have to use the following formula in the formula bar.
=COUNTIFS([INDEX](https://geekexcel.com/index-function-in-microsoft-excel-365-how-to-use/)(Table1,0,[MATCH](https://geekexcel.com/how-to-use-match-function-in-microsoft-excel-365/)(G5,Table1[#Headers],0)),"x")

Enter fullscreen mode Exit fullscreen mode

Use the Formula

  • Then, you will get the result for the swim in the cell H5.

Result for the Swim

  • Now, to use COUNTIFS with a variable table column for run , you have to use the following formula in the formula bar.
=COUNTIFS([INDEX](https://geekexcel.com/index-function-in-microsoft-excel-365-how-to-use/)(Table1,0,[MATCH](https://geekexcel.com/how-to-use-match-function-in-microsoft-excel-365/)(G6,Table1[#Headers],0)),"x")

Enter fullscreen mode Exit fullscreen mode

Use the Formula

  • After that, you will get the result for the run in the cell H6.

Result for Run

  • To use COUNTIFS with a variable table column for bike , you have to use the following formula in the formula bar.
=COUNTIFS([INDEX](https://geekexcel.com/index-function-in-microsoft-excel-365-how-to-use/)(Table1,0,[MATCH](https://geekexcel.com/how-to-use-match-function-in-microsoft-excel-365/)(G7,Table1[#Headers],0)),"x")

Enter fullscreen mode Exit fullscreen mode

Use the Formula

  • Finally, you will get the result for the bike in the cell H7.

Result for Bike

Wrap-Up

From this tutorial, you can get some clarification on formulas to use COUNTIFS with the variable table column in Excel. If you have any other ideas or questions , do share them with us here in the comment section below. Thank you so much for visiting Geek Excel!! *If you want to learn more helpful formulas, check out Excel Formulas *!!

Keep Reading:

Top comments (0)