Omprakash
Omprakash

Reputation: 3

Getting the criteria range in countif function through vlookup

I have an Excel file with headers branch code, product type, final channel, alternate channel, etc up to 50 columns. Each branch in the country has different branch code. And there are different types of product.

I want to get the count of product type of each branch. The issue is that the columns change their position in each Excel. So instead of selecting the criteria range in countif function, I want the range to be traced through lookup or any other function as the header names remain same.

For e.g. =countif( range with header name product type, "product name")

Upvotes: 0

Views: 78

Answers (1)

user4039065
user4039065

Reputation:

try,

=countif(index(a:az, 0, match("product type", 1:1, 0)), "product name")

Upvotes: 1

Related Questions