countif and vlookup

vavs

Well-known Member
Joined
Jul 2, 2004
Messages
514
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

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi,

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

=IF(W1DISC!B8=1,add your other formula here,"")

Hope this helps

Ron
 
Upvote 0
Your formula should be along the lines of:-

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

Forum statistics

Threads
1,214,590
Messages
6,120,421
Members
448,961
Latest member
nzskater

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