# 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

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

#### 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
4
Views
274
Replies
2
Views
319
Replies
7
Views
303
Replies
2
Views
152
Replies
1
Views
219

Understanding data is crucial, and the easiest place to start is with Microsoft Excel.

1,151,589
Messages
5,765,312
Members
425,272
Latest member
Umba

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