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

Dan Morris

New Member
Joined
May 22, 2012
Messages
34
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
 

Some videos you may like

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Dan Morris

New Member
Joined
May 22, 2012
Messages
34
Dear Tetra201 - that works beautifully; thank you so much for your help, it's very much appreciated :)

Dan
 

Dan Morris

New Member
Joined
May 22, 2012
Messages
34

ADVERTISEMENT

Saved my night :)
 

Dan Morris

New Member
Joined
May 22, 2012
Messages
34
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 :)
 

Tetra201

MrExcel MVP
Joined
Oct 14, 2016
Messages
3,631

ADVERTISEMENT

If zero in column C is a valid number, then use:

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

Watch MrExcel Video

Forum statistics

Threads
1,122,355
Messages
5,595,676
Members
414,009
Latest member
SNesbyCarr

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
Top