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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,223,896
Messages
6,175,259
Members
452,626
Latest member
huntinghunter

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