#### broncos347

##### Active Member
I have two columns (AS and BV).

What I would like to do is to total up the number of sites that are asigned to a number of contractors (A, B and C).

The contractors are listed in AS and the data I would like to add up is in BV.

What I am after is a total number (not sum) for each contractor. I have started to try countif but I can't seem to make it work.

Regards,

Ian.

### Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Do you mean you want to add the number of sites for each contractor? I think this works:
Book1
ABCDE
1Contractor# of SitesContractorTotal Sites
2A3A6
3B5B18
4B2C3
5B4
6B6
7A1
8A2
9B1
10C3
Sheet1

Nearly, but not quite.

The column I am using (BV) contains costs and what I want to do is to find out how many sites have been quoted by each contractor.

Is this possible?

Then couldn't you just count the number of times the contractor name appears instead of dealing with the costs column?

Using the same setup as in my previous post, use this formula instead:
=COUNTIF(\$A\$2:\$A\$10,\$D2)

and copy the formula down.

The results I get are
A=3
B=5
C=1

Unfortunately, the column I am trying to use contains costs and are therefore different.

What I am trying to find out is, out of say 200 sites how many has contractor A costed and how many has contractor B costed.

So rather than "sum" the column BV I would like to be able to just count up the number of cells in the column that contain data.

broncos347 said:
What I am trying to find out is, out of say 200 sites how many has contractor A costed and how many has contractor B costed.

So rather than "sum" the column BV I would like to be able to just count up the number of cells in the column that contain data.

Riiiiight....and what the last formula I posted does is count the number of times each contractor name appears in column A--which is one time for each cost listed in column B. So I just counted the number of times the contractor name appears.

It should work just the same

Unless, of course, you have listed the contractors in column A and there is nothing in column B for that row for some reason. That would need a different formula:
Book1
ABCDE
1ContractorCostContractorTotal
2A1A2
3B3B3
4B1C2
5B4
6B
7C5
8C
9A4
10C1
Sheet1

Thanks works great.

Replies
3
Views
292
Replies
5
Views
138
Replies
5
Views
166
Replies
7
Views
159
Replies
7
Views
252

1,196,288
Messages
6,014,500
Members
441,825
Latest member

### 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.

### Which adblocker are you using?

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

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