scan cells and return sum of values in adjacent cells if they contain a specific value

merlin777

Well-known Member
Joined
Aug 29, 2009
Messages
1,397
Office Version
  1. 2007
I used to know how to do this but its slipped away from me....

On one sheet I have a number of cells which contain the code 'cc'.I want to get the sum of the values in the cells to the right of each one of the cells with cc in them.

The cells are all contained within a certain area but not in a table (there may be some tables within the area though). I dont see any reason why I couldn't make this area a named range.

I think when I was helped with this before it was to compile a list of the values in the adjacent cells, even though it wasn't possible to know how many there were and and now its just a sum of the numeric values so hopefully it should be a bit simpler.

I'd prefer a normal cell formula but VBA would be OK if its straightforward as i'm a bit rusty!

Any help would be greatly appreciated. TIA!
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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