Count Formula With Variable

carlclements

New Member
Joined
Oct 17, 2024
Messages
6
Office Version
  1. 2021
Platform
  1. Windows
Hi.

I have a table of football player data that is used for a summary table of matches played, average minutes per match and goals for each player.
Column B lists the players
Columns C - AC is data depending on the row:
- row 1 is either T1 or T2 (T = Tier)
- row 2 is W1 - W26 (W = Week)
- row 3 onwards are the number of minutes played by the players in column B

To count the number of matches played for the first player in row 3, I'm using =COUNTA(C3:AC3).

How do adjust this formula to only count matches played when T1 is populated in row 1 of the columns?

For example, with the below data, my count of matches played for Jimena is 3 (mins played in W1, W2 and W3 but not W4). But I want to count only the matches when T1 was in row 1.

T1T2T2T2
W1W2W3W4
Jimena808080
Schyler80

Thanks
 
Im assuming your table is not accurate and has become misaligned in the paste, T1 and W1 should be one cell to the right??? If so you could try this formula:
Excel Formula:
=COUNTIFS(C3:AC3,"<>""",C$1:AC$1,"T1")
 
Upvote 0
Yes. the table did misalign when I posted it, apologies. Trying again now with the full row.

I need the formula to return 8, which is a count of cells containing numbers when T1 is in row 1 (highlighted yellow). The countifs formula suggested above returns 12

1741911273950.png
 
Upvote 0

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