Summing up values with a special condition

FCH

New Member
Joined
Mar 6, 2002
Messages
5
Hello,

I've got a row with YES or NO in every cells and I would like to sum up all the values under the NOs with the first Yes, until it reaches the next YES. How can it be done?
Ex.
YES NO NO NO ¦YES NO NO ¦YES...
Values 5 5 10 10 ¦15 10 15 ¦5
>Result 30 ¦40 ¦...

Hope you understand. Thank you in advance for you help.
Fred.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
On 2002-03-07 08:04, FCH wrote:
Hello,

I've got a row with YES or NO in every cells and I would like to sum up all the values under the NOs with the first Yes, until it reaches the next YES. How can it be done?
Ex.
YES NO NO NO ¦YES NO NO ¦YES...
Values 5 5 10 10 ¦15 10 15 ¦5
>Result 30 ¦40 ¦...

Hope you understand. Thank you in advance for you help.
Fred.

Lets say that A1:H1 houses the YES/NO data and A2:H2 the corresponding values:

In A3 enter and copy across till H3:

=IF(A1="YES",SUM(A$2:INDIRECT(ADDRESS(2,MATCH(A1,B1:$H$1,0)+COLUMN()-1))),"")

Aladin
 
Upvote 0
On 2002-03-07 21:54, Aladin Akyurek wrote:
On 2002-03-07 08:04, FCH wrote:
Hello,

I've got a row with YES or NO in every cells and I would like to sum up all the values under the NOs with the first Yes, until it reaches the next YES. How can it be done?
Ex.
YES NO NO NO ¦YES NO NO ¦YES...
Values 5 5 10 10 ¦15 10 15 ¦5
>Result 30 ¦40 ¦...

Hope you understand. Thank you in advance for you help.
Fred.

Lets say that A1:H1 houses the YES/NO data and A2:H2 the corresponding values:

In A3 enter and copy across till H3:

=IF(A1="YES",SUM(A$2:INDIRECT(ADDRESS(2,MATCH(A1,B1:$H$1,0)+COLUMN()-1))),"")

Aladin
Great, it works. Thanks a lot.
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,545
Members
449,089
Latest member
davidcom

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