How do I count one column dependent on value in another column?

Dan Morris

New Member
Joined
May 22, 2012
Messages
37
Office Version
  1. 365
Platform
  1. Windows
I have a spreadsheet of staff a little like this (but with hundreds of names in several locations or different departments:

A B C
1 NAME LOCATION EFT
2 Fred Bloggs London 1.0
3 Jane Bloggs London 0.75
4 John Blaggs Salford 1.0
5 Richard Hobbs London 0.5
6 Tim Huggins Cardiff 0.6
7 Janet Smith Salford 1.0

What I need to do is create counts of both HEADCOUNT (ie: actual number of people) and EFT (ie: some staff are part time and EFT is the equivalent amount of full-time staff).

To get an accurate count on HEADCOUNT of everyone in London, I am using this:
= COUNTIF($B2:$B7,"London")
And that would give me the total number of everyone with London set as the location (ie: 3 people in the above example)

What I can’t understand is how to do the same with EFT, so using the above example the equation would have to ask does it have “London” in column B, and if it does add up the figures in column C, so London would equal 2.25 in the above example.

I’d be so grateful if someone could tell me how to make that equation.

Thank you so much. Dan
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Dear Tetra201 - that works beautifully; thank you so much for your help, it's very much appreciated :)

Dan
 
Upvote 0
One further question please:

So what if I want to count 1 for each number in column c (irrespective of what it is) if we have “London” in column B. So in the above example the first equation resulted in 2.25, now I need an equation that would say: 3 of the rows in column C contain a number and also contain “London in column B = 3

(It's not as simple as just counting column B as the real spreadsheet as many other columns which complicate it and means that it has to be a count depending on both columns).

THANK YOU :)
 
Upvote 0
If zero in column C is a valid number, then use:

=SUMPRODUCT(($B$2:$B$7="London")*ISNUMBER($C$2:$C$7))
 
Upvote 0

Forum statistics

Threads
1,214,667
Messages
6,120,822
Members
448,990
Latest member
rohitsomani

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