COUNTIFS

carlclements

New Member
Joined
Oct 17, 2024
Messages
3
Office Version
  1. 2021
Platform
  1. Windows
Hi,
Is there a COUNTIF formula that counts the number of cells with data (numbers) in group of columns based on a reference data point in column B?

My spreadsheet has 2 tabs. First tab has a list of names in column B then in columns C onwards are descending years. Each row has a name in column B and a number under one of the years (columns) with the rest of the columns empty

On another tab, I reference the Names in a cell in column B and want to count the frequency of cells with a number in it with that Name in the list

The below formula works for the first set of years in columns D-H but how do I adjust the formula to look at a different set of columns, which is to only count cells in columns I-L and exclude those in B-H?

=COUNTIFS('Data (2)'!B:H,'Values'!B3)
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Welcome to the forum.

I don't understand the relation between your description and the formula you posted. That formula just counts cells in columns B:H that contains the value in B3 in the Values sheet. From your description, you might as well have used:

Excel Formula:
=COUNTIFS('Data (2)'!B:B,'Values'!B3)

since only column B contains names. The formula takes no account of whether there are numbers in columns C:H or not.
 
Upvote 0
Indeed as Rory suggested...

So I'm not sure if this is what you need ?

Assuming you do a lookup in Col A for the name in B3, then count how many entries are across his row ?

Book1
ABCDEFGH
1
2200520042003200220012000
3Fred2
4Bill4
5John3
6Ron6
7Dave5
8
9
Data


Book1
ABCD
1
2
3Fred1
4
5
Values
Cell Formulas
RangeFormula
C3C3=COUNT(XLOOKUP(B3,Data!A3:A7,Data!B3:H7,""))
 
Upvote 0
Sorry, i didn't explain well. Here is a sample of the data

1729179759045.png


And I would like a formula that counts how many cells within a column range are populated with a number for each name. I have manually entered below

1729179860884.png
 
Upvote 0
You could use FILTER:

Excel Formula:
=COUNT(FILTER('Data (2)'!$I$2:$L$1000,'Data (2)'!$B$2:$B$1000='Values'!B3))
 
Upvote 0
Solution
Maybe something like this (formulas different in each year range, and type the name manually into cell A10)

Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAA
12024202320222021202020192018201720162015201420132012201120102009200820072006200520042003200220012000
2Fred165155.5165213.5155194
3Fred200149.6
4Bill145
5Bill
6
7
8
92020-now2015-20192010-20142005-20092000-2004
10Fred35000
11
12
13
Sheet2
Cell Formulas
RangeFormula
B10B10=COUNT(FILTER(B2:F5,A2:A5=A10,""))
C10C10=COUNT(FILTER(G2:K5,A2:A5=A10,""))
D10D10=COUNT(FILTER(L2:P5,A2:A5=A10,""))
E10E10=COUNT(FILTER(Q2:U5,A2:A5=A10,""))
F10F10=COUNT(FILTER(V2:Z5,A2:A5=A10,""))


Sorry, forgot you had 2 sheets... so heres an example:

Book1
ABCD
1
22020-nowetc..
3Fred3
4
Values
Cell Formulas
RangeFormula
C3C3=COUNT(FILTER(Data!B2:F5,Data!A2:A5=B3,""))


But like Rory says really ...
 
Upvote 0

Forum statistics

Threads
1,223,101
Messages
6,170,116
Members
452,302
Latest member
TaMere

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