Count only rows with data, without using fixed columns

gidBeat

New Member
Joined
Mar 8, 2018
Messages
3
Hello

I want to count only the rows that contain at least one cell of data (text OR numbers), within a specified range of columns. However, I don't want to specify the range of columns using their fixed column letter names, but using the text in row 1 as the column header. (This Row 1 text is set up to be variable, so it will be different for every individual usage of the workbook that I am creating, so I can't just plug in the fixed column names)

Ideally I want a formula (rather than a Macro/VBA code) to put into a cell on another sheet and just provide a count. If I use a Macro/VBA then it will decrease the user-friendliness of the workbook I'm creating (it's a tool for my non-technical team to automate quantitative survey data analysis, with variable, but predictable, data inputs).

I have found many tips and formulas to count only the rows that contain at least one cell of data (below), but none that allow this variable column functionality

<colgroup><col style="mso-width-source:userset;mso-width-alt:9910;width:203pt" width="271"> </colgroup><tbody>
[TD="class: xl65, width: 271"] https://stackoverflow.com/questions/6867070/how-can-i-count-the-rows-with-data-in-an-excel-sheet
[/TD]

[TD="class: xl65"] https://organicweb.com.au/7877/general-technology/excel-function-instructions/
[/TD]

</tbody>

For example, the values in row 1 will read: Q1, Q2, Q3, Q3.2, Q3.3, Q3.4, Q4, Q4.2, Q5, etc., where the number of columns with decimals allocated will vary depending on previous inputs and will occupy different columns each time the workbook is used. Now, say for example I want to look at just columns relating to Q3 (so including Q3.2, Q3.3, Q3.4, etc). I am totally lost on how to do this without using fixed column names.

Any help much appreciated!

Thanks
Matt
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hi , does anyone have any ideas on the above? If it is unclear, here is a demonstration of what I'm trying to do (where '1' could be any text or number value). If something still remains unclear, please let me know what and I will explain.


<colgroup><col style="width:48pt" width="64" span="10"> </colgroup><tbody>
[TD="class: xl66, width: 64"]Q1[/TD]
[TD="class: xl66, width: 64"]Q2[/TD]
[TD="class: xl66, width: 64"]Q3[/TD]
[TD="class: xl66, width: 64"]Q3.2[/TD]
[TD="class: xl66, width: 64"]Q3.3[/TD]
[TD="class: xl66, width: 64"]Q3.4[/TD]
[TD="class: xl66, width: 64"]Q4[/TD]
[TD="class: xl66, width: 64"]Q4.2[/TD]
[TD="class: xl66, width: 64"]Q5[/TD]
[TD="width: 64"][/TD]

[TD="class: xl66"]1[/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"]1[/TD]

[TD="class: xl66"]1[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"]1[/TD]

[TD="class: xl66"]1[/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"]1[/TD]

[TD="class: xl66"]1[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]1[/TD]

[TD="class: xl66"]1[/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]1[/TD]

[TD="class: xl66"]1[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"]1[/TD]

[TD="class: xl66"]1[/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl66"]1[/TD]

[TD="colspan: 2"]Answer for Q3: 4
[/TD]

[TD="class: xl65"][/TD]
[TD="colspan: 7"](number of rows with at least one cell of data for Q3/Q3.2/Q3.3/Q3.4)
[/TD]

[TD="colspan: 2"]Answer for Q4: 6
[/TD]

[TD="class: xl65"][/TD]
[TD="colspan: 6"](number of rows with at least one cell of data for Q4/Q4.2)
[/TD]

[TD="colspan: 2"]Answer for Q5: 7
[/TD]

[TD="class: xl65"][/TD]
[TD="colspan: 6"](number of rows with at least one cell of data for Q5)[/TD]

</tbody>
 
Upvote 0

Forum statistics

Threads
1,223,711
Messages
6,174,025
Members
452,542
Latest member
Bricklin

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