ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   COUNT using 2 different criterias (https://www.excelbanter.com/excel-discussion-misc-queries/208959-count-using-2-different-criterias.html)

fsfiligoi

COUNT using 2 different criterias
 
Hello. I'm trying to count how many days I worked remotly, how many days I
was sick and how many vacation days I took each month.
Month Date Type
Jan 5 Work Remotly
Jan 6 Sick Day
Jan 23 Work Remotly
Feb 11 Sick Day
Mar 16 Work Remotly
Mar 17 Vacation Day
In this example, this would be the result:
Jan Feb Mar Type
2 0 1 Work Remotly
1 1 0 Sick Day
0 0 1 Vacation Day
What would the formula be to get those results? Thanks! Fatima

T. Valko

COUNT using 2 different criterias
 
With this data in the range A2:C7

Jan 5 Work Remotly
Jan 6 Sick Day
Jan 23 Work Remotly
Feb 11 Sick Day
Mar 16 Work Remotly
Mar 17 Vacation Day


F1:I1 = headers = Jan Feb Mar Type

I2:I4 = Work Remotly; Sick Day; Vacation Day

Enter this formula in F2:

=SUMPRODUCT(--($A$2:$A$7=F$1),--($C$2:$C$7=$I2))

Copy across to H2 then down to row 4


--
Biff
Microsoft Excel MVP


"fsfiligoi" wrote in message
...
Hello. I'm trying to count how many days I worked remotly, how many days
I
was sick and how many vacation days I took each month.
Month Date Type
Jan 5 Work Remotly
Jan 6 Sick Day
Jan 23 Work Remotly
Feb 11 Sick Day
Mar 16 Work Remotly
Mar 17 Vacation Day
In this example, this would be the result:
Jan Feb Mar Type
2 0 1 Work Remotly
1 1 0 Sick Day
0 0 1 Vacation Day
What would the formula be to get those results? Thanks! Fatima




Roger Govier[_3_]

COUNT using 2 different criterias
 
Hi
The easiest way is with a Pivot Table
Place you cursor anywhere within your dataDataPivot TablesFinish
On the Pivot Table skeleton that appears on the new sheet
Drag Month to the column area
Drag Type to the Row area
Drag Type again to the Data area (where it will show Count of Type)
--
Regards
Roger Govier

"fsfiligoi" wrote in message
...
Hello. I'm trying to count how many days I worked remotly, how many days
I
was sick and how many vacation days I took each month.
Month Date Type
Jan 5 Work Remotly
Jan 6 Sick Day
Jan 23 Work Remotly
Feb 11 Sick Day
Mar 16 Work Remotly
Mar 17 Vacation Day
In this example, this would be the result:
Jan Feb Mar Type
2 0 1 Work Remotly
1 1 0 Sick Day
0 0 1 Vacation Day
What would the formula be to get those results? Thanks! Fatima



fsfiligoi

COUNT using 2 different criterias
 
This is exactly what I was looking for! Thank you!

"fsfiligoi" wrote:

Hello. I'm trying to count how many days I worked remotly, how many days I
was sick and how many vacation days I took each month.
Month Date Type
Jan 5 Work Remotly
Jan 6 Sick Day
Jan 23 Work Remotly
Feb 11 Sick Day
Mar 16 Work Remotly
Mar 17 Vacation Day
In this example, this would be the result:
Jan Feb Mar Type
2 0 1 Work Remotly
1 1 0 Sick Day
0 0 1 Vacation Day
What would the formula be to get those results? Thanks! Fatima


fsfiligoi

COUNT using 2 different criterias
 
Thanks a lot! This is what I was looking for. Fatima

"T. Valko" wrote:

With this data in the range A2:C7

Jan 5 Work Remotly
Jan 6 Sick Day
Jan 23 Work Remotly
Feb 11 Sick Day
Mar 16 Work Remotly
Mar 17 Vacation Day


F1:I1 = headers = Jan Feb Mar Type

I2:I4 = Work Remotly; Sick Day; Vacation Day

Enter this formula in F2:

=SUMPRODUCT(--($A$2:$A$7=F$1),--($C$2:$C$7=$I2))

Copy across to H2 then down to row 4


--
Biff
Microsoft Excel MVP


"fsfiligoi" wrote in message
...
Hello. I'm trying to count how many days I worked remotly, how many days
I
was sick and how many vacation days I took each month.
Month Date Type
Jan 5 Work Remotly
Jan 6 Sick Day
Jan 23 Work Remotly
Feb 11 Sick Day
Mar 16 Work Remotly
Mar 17 Vacation Day
In this example, this would be the result:
Jan Feb Mar Type
2 0 1 Work Remotly
1 1 0 Sick Day
0 0 1 Vacation Day
What would the formula be to get those results? Thanks! Fatima





T. Valko

COUNT using 2 different criterias
 
You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"fsfiligoi" wrote in message
...
Thanks a lot! This is what I was looking for. Fatima

"T. Valko" wrote:

With this data in the range A2:C7

Jan 5 Work Remotly
Jan 6 Sick Day
Jan 23 Work Remotly
Feb 11 Sick Day
Mar 16 Work Remotly
Mar 17 Vacation Day


F1:I1 = headers = Jan Feb Mar Type

I2:I4 = Work Remotly; Sick Day; Vacation Day

Enter this formula in F2:

=SUMPRODUCT(--($A$2:$A$7=F$1),--($C$2:$C$7=$I2))

Copy across to H2 then down to row 4


--
Biff
Microsoft Excel MVP


"fsfiligoi" wrote in message
...
Hello. I'm trying to count how many days I worked remotly, how many
days
I
was sick and how many vacation days I took each month.
Month Date Type
Jan 5 Work Remotly
Jan 6 Sick Day
Jan 23 Work Remotly
Feb 11 Sick Day
Mar 16 Work Remotly
Mar 17 Vacation Day
In this example, this would be the result:
Jan Feb Mar Type
2 0 1 Work Remotly
1 1 0 Sick Day
0 0 1 Vacation Day
What would the formula be to get those results? Thanks! Fatima








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

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