Countif + vlookup

baker_89

New Member
Joined
Aug 25, 2014
Messages
42
Hi 1st Time posting,

Sheet 1 has a table with 5 columns (Name (A1), Date (B1), Type of Occurrence (C1), Reason (D1), (Un)Excused (E1)), the fields are filled through questions through a user form. The contents will vary within a set number of values from the above mentioned.

On Sheet 2 I have 3 columns (Name (A3), Absent (B3), Tardy (C3)).

I want Sheet 2 to look up the Names (A) from Sheet 2 to the Names (A) on Sheet 1 and count the matching number of "Absent" (B) and "Tardy" (C) From the Type of Occurrence column on Sheet 1.

Just to show a total count of each time it comes up.

I've tried a few different formulas and sure I could use a pivot table to show this as well but I would like to try it using a formula.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Hi 1st Time posting,

Sheet 1 has a table with 5 columns (Name (A1), Date (B1), Type of Occurrence (C1), Reason (D1), (Un)Excused (E1)), the fields are filled through questions through a user form. The contents will vary within a set number of values from the above mentioned.

On Sheet 2 I have 3 columns (Name (A3), Absent (B3), Tardy (C3)).

I want Sheet 2 to look up the Names (A) from Sheet 2 to the Names (A) on Sheet 1 and count the matching number of "Absent" (B) and "Tardy" (C) From the Type of Occurrence column on Sheet 1.

Just to show a total count of each time it comes up.

I've tried a few different formulas and sure I could use a pivot table to show this as well but I would like to try it using a formula.

If you are using Excel 2007 or later, you can try the following in cell B4 on Sheet2 and copy to column C and down:
Code:
=COUNTIFS(Sheet1!$A:$A,Sheet2!$A4,Sheet1!$C:$C,Sheet2!B$3)
If you are using an earlier version of Excel, you can use an array formula in cell B4 and copy to column C and down:
Code:
=SUM(IF((Sheet1!$A:$A=Sheet2!$A4)*(Sheet1!$C:$C=Sheet2!B$3),1,0))
Remember that the array formula must be entered with Ctrl+Shift+Enter and not just Enter.

I hope this helps!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,113
Messages
6,128,905
Members
449,478
Latest member
Davenil

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