Countif vba???

SAMCRO2014

Board Regular
Joined
Sep 3, 2015
Messages
158
I am trying to find a away to count how may times an employee number shows in Column F and results in Column U. I just can't get it to work with a formula let alone a VBA! I need the information to use in a formula to pro rate costs.

I need the information to look like this:

EE # Results
1111 1
2222 1
3333 2
3333 2
1234 3
1234 3
1234 3

Help!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
How about, something like this just copied down.
=COUNTIF(F$2:F$100,F2)
 
Upvote 0
That worked! Now to add another level. For each employee I need to calculate the number of times a date shows up with their employee number. I keep getting zero when I should get an answer of atleast one!!!

PRIStart DateEnd DateResults S/B
1075360519-04-0119-10-18 1
1726003519-04-0119-09-08 2
1726003519-04-0119-09-08 2
1726003519-09-0919-10-18 2
1726003519-09-0919-10-18 2
1923499619-04-0119-04-26 1
1923499619-07-0219-08-18 1
1923499619-08-1919-09-30 1
1923499619-10-0119-10-18 1

<colgroup><col><col span="3"></colgroup><tbody>
</tbody>
 
Upvote 0
What did you try?
And what date?
 
Last edited:
Upvote 0
I tried your formula above. OK. Perhaps I give you a bit of detail. I need to pro-rate a cost based per EE number and the same date range (which is variable). So if any employee has only one date range, I need it to return the number 2. The problem is when I have an employee who has several of the same date range. such as in the data above . One employee has two date ranges but are the same. For example Employee 17260035 worked for tow different managers from April 1 - September 8. I have a total costs of $100. I need something to count those date ranges per EE so 50% of the costs go to one manager and 50% of the costs go to another for that time frame. It could be 25%, 33%, etc.....it is variable.

PRIStart DateEnd DateResults S/B
1075360519-04-0119-10-18 1
1726003519-04-0119-09-08 2
1726003519-04-0119-09-08 2
1726003519-09-0919-10-18 2
1726003519-09-0919-10-18 2

<tbody style="border-collapse: collapse; border-spacing: 0px 0px; font-size: 13px; margin-bottom: 0px;">
</tbody>
 
Upvote 0
How about
=COUNTIFS(F:F,F2,G:G,G2,H:H,H2)
 
Upvote 0
My pleasure & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,731
Members
448,987
Latest member
marion_davis

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