ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Counting 2 Separate Columns With Unique Data (https://www.excelbanter.com/excel-programming/276570-counting-2-separate-columns-unique-data.html)

JAYDE

Counting 2 Separate Columns With Unique Data
 
I WONDER IF THIS COULD BE DONE IN VBA

I wish to count how many people we pay as full time, part time or
temporary staff. This requires the formula to look in one column for
where type is FT and in another column for where salary is 0. When
these conditions are met, it should count how many cells in the salary
row have a salary figure and that will be our headcount for that
period.

A sample data is below:

A Staff name BType C Salary
Ken FT 3500
Toni FT 3500
Del PT 2980
Dave FT 0

The above should return 2 for full time headcount because Dave is no
longer with the company.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Tom Ogilvy

Counting 2 Separate Columns With Unique Data
 
=Sumproduct(($B$1:$B$500="FT")*($C$1:$C$5000))

will give you the count.

--
Regards,
Tom Ogilvy

"JAYDE" wrote in message
...
I WONDER IF THIS COULD BE DONE IN VBA

I wish to count how many people we pay as full time, part time or
temporary staff. This requires the formula to look in one column for
where type is FT and in another column for where salary is 0. When
these conditions are met, it should count how many cells in the salary
row have a salary figure and that will be our headcount for that
period.

A sample data is below:

A Staff name BType C Salary
Ken FT 3500
Toni FT 3500
Del PT 2980
Dave FT 0

The above should return 2 for full time headcount because Dave is no
longer with the company.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/





All times are GMT +1. The time now is 12:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com