# countif and vlookup

#### vavs

##### Well-known Member
I am trying to sum a column from multiple worksheets based on three criteria from another worksheet. I have a worksheet for each month over the past year. In that worksheet I have a column called "useage". This value should be sum totaled if and only if the column "Accountnumber" is in a sheet called W1DISC and the 8th column = "1". To complicate matters, the accountnumber column is derived by a VLOOKUP of yet another worksheet. The VLOOKUP of the accountnumber is working famously.

Here is what I would like to do,

If accountnumber in sheet a is (in sheet b and column 8 = 1), then add the useage value to the total number of gallons. I would like to know the total number of accepted values so I can average them.

I think I am close, but I cannot seem to get to the end of this problem.

### Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

#### Ron Morris

##### Active Member
Hi,

Don't know what the rest of your formula looks like but you can use an If fomula ahead of your sum formula.

Hope this helps

Ron

#### Todd Bardoni

##### Well-known Member
Your formula should be along the lines of:-

if(isna(vlookup)),"not_found",if(vlookup)=1,do_something)

Replies
12
Views
151
Replies
2
Views
258
Replies
7
Views
105
Replies
11
Views
318
Replies
7
Views
204

1,181,745
Messages
5,931,783
Members
436,803
Latest member
Strycure12

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