Counting number of occurrances

G

Guest

I wrote in previously but still having difficulties. Please pardon my ignorance if this is not as complicated as I'm making it. I've tried to rewrite the problem to be more clear. Thank you for any help or direction you can give.

I need to figure the value/forumla for Sheet2 cels B2, C2, D2... B3, C3, D3... etc. using the following criteria:

Sheet1, Column A, any number of rows contain a "NAME" i.e. Phillip, Corey, Ana, etc.
Sheet2, Column A, contains the same values of "NAME"

Sheet1, Column C, any number of rows, contain a number corresponding to a DAY of the month
Sheet2, Colums A thru AF contain the numbers 1 thru 31 corresponding to a DAY of the month

I need to compare every row in Sheet1!C:C to see if it equals that same number in Sheet2!A1 thru AF

If the numbers (DAY) match, then I need to count how many of those matches also contain the same "NAME." The condition where Sheet1!C:C equals Sheet2!A1 (A1=Phillip, A2=Corey, A3=Ana, etc.) Then that final number would be input into the cel Sheet2!B2

If the numbers do not match, then the cel Sheet2!B2 should be blank.

I've tried several funtions/forumals and just can't seem to get it right. I believe I have the logic correct:

Loop through all rows in Sheet1
Count how many rows contain the same DAY
End Loop

Loop through all rows in Sheet1 that contain the same DAY
Count how many NAME are on the same DAY
End Loop

Write the number of occurrances of NAME on the same DAY to cel on Sheet2 that corresponds to the number of the day.

Here is how the final output should look:

Sheet1
======
A B C D E
1| Name Day
--|---------------------------------------
2| Phillip 1
3| Phillip 1
4| Corey 1
5| Ana 2
6| Ana 2
7| Phillip 2
8| Corey 3
9| Ana 3
10| Corey 4

Sheet2
======
A B C D E ... AE AF
1| Days--> 1 2 3 4 30 31
--|----------------------------------------------------------------
2| Phillip 2 1
3| Corey 1 1 1
4| Ana 2 1
5| Gus
6| Josh
7| Barbara
 
M

martin

Put a helper col in Sheet1
Concatenate the name from colA and day from colC ie if
colH is the helper col enter this formula = A2 & C2
Concatenate the name and day when you do your counifs on
colH ie countif(phillip & 1 ...
-----Original Message-----
I wrote in previously but still having difficulties.
Please pardon my ignorance if this is not as complicated
as I'm making it. I've tried to rewrite the problem to be
more clear. Thank you for any help or direction you can
give.
I need to figure the value/forumla for Sheet2 cels B2,
C2, D2... B3, C3, D3... etc. using the following criteria:
Sheet1, Column A, any number of rows contain a "NAME" i.e. Phillip, Corey, Ana, etc.
Sheet2, Column A, contains the same values of "NAME"

Sheet1, Column C, any number of rows, contain a number
corresponding to a DAY of the month
Sheet2, Colums A thru AF contain the numbers 1 thru 31
corresponding to a DAY of the month
I need to compare every row in Sheet1!C:C to see if it
equals that same number in Sheet2!A1 thru AF
If the numbers (DAY) match, then I need to count how many
of those matches also contain the same "NAME." The
condition where Sheet1!C:C equals Sheet2!A1 (A1=Phillip,
A2=Corey, A3=Ana, etc.) Then that final number would be
input into the cel Sheet2!B2
If the numbers do not match, then the cel Sheet2!B2 should be blank.

I've tried several funtions/forumals and just can't seem
to get it right. I believe I have the logic correct:
Loop through all rows in Sheet1
Count how many rows contain the same DAY
End Loop

Loop through all rows in Sheet1 that contain the same DAY
Count how many NAME are on the same DAY
End Loop

Write the number of occurrances of NAME on the same DAY
to cel on Sheet2 that corresponds to the number of the day.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top