Using COUNTIFS with INDEX MATCH

torchedya

New Member
Joined
Dec 22, 2017
Messages
4
I have a CSV file that is exported from a program that we use, which is then pasted into a sheet in our excel workbook. The issue is the CSV may have different headings in different columns depending on who downloaded it. So when I pull the spreadsheet the heading "Hostname" is in column D but when someone else does it the heading "Hostname" may be in column G. We use this spreadsheet to count how many devices we have deployed. I have figured out how to do a INDEX MATCH if I am pulling from only one heading:

=COUNTIF(INDEX('Sheet1'!$A$2:$AZ$5000,0,MATCH("Hostname",'Sheet1'!$A$1:$AZ$1,0)),"*pdu-mine*")

But some of my formulas currently pull from different columns and not just one for example:

=COUNTIFS('Sheet1'!A1:A5000,"*Virtual*','Sheet1'!L1:L5000,"*my house*"

Column A is "Type" and Column L is "Location". How can I use COUNTIFS for multiple headings that may move around on the sheet?

And if you are really looking for a challenge then how can I do it with a formula array that is already as complex as the below example:

{=SUM(IF(FREQUENCY(IF(ISNUMBER(SEARCH("*emu-mine*",'Sheet1'!D1:D5000)),MATCH('Sheet1'!D1:D5000,'Sheet1'!D1:D5000,0)),ROW('Sheet1'!D1:D5000)-ROW('Sheet1'!D2)+1),1))}

Thanks!!

<tbody>
</tbody><colgroup><col></colgroup>

<tbody>
</tbody><colgroup><col></colgroup>
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,216,759
Messages
6,132,550
Members
449,735
Latest member
Gary_M

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top