Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Formula until condition met

How can I SUMIF subject to each successive previous cell's value being less
than the value of the former cell?

I'm using a COUNTIF formula to determine the number of entries in each column.
The table looks something like this:

V2A: 10 20 5 10 5 10 where "V2A" stands for "Value to Add."
CI: 2 6 4 1 3 5 where "CI:" stands for "COUNT IF" values.

R1: x x x x x x where "R" stands for "ROW" as in "ROW 1:"
R2: x x x - x x where "x" stands for a value in a cell.
R3: - x x - x x where "-" stands for an empty cell.
R4: - x x - - x
R5: - x - - - x
R6: - x - - - -
Res: 0 10 0 0 10 20 where "Res:" stands for "Results."

Explanation:
I am looking for a formula that will calculate the results row, (the "Res:"
row). I have 31 columns, so nested IF statements probably won't work.

I used COUNTIF to determine the values to the right of CI. The formula that I
need must SUM the V2A values if the CI values to the columns in coluleft are
lower thanmns to the right. Therefore, the result in column 1 is '0' because
there is no value to the left of the column. The result in column 2 is 10,
because its CI value of 6 is greater than the value of 2 from the column to
its left. The results of columns 3 and 4 are 0 because the columns to their
left are greater. Notice that since the 2nd column has a greater value than
those to its left, (column 1), column 1's value is not SUMmed in formulas to
the right of column 2. The result in column 5 is 10, because the row to the
left has a lesser CI value. The result for column 6 is 20, because it is
greater than the previous 3 columns CI values, but less than column 2's CI
value.

This problem has been driving me nuts! Any help would be appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Formula until condition met

Wow! That was a quick reply!

Thank you. I will try and see what happens. Will post feedback for the
benefit of others.

When the values are equal, to the left of, and less than the column being
calculated, all V2A's of the equal columns get added to the column being
calculated, on condition that there is not a column with a higher CI value
than the column being calculated in between the columns to the left.

GBExcel

barry houdini wrote:
Hello GBExcel, Not sure what happens when the values are equal.....bu
assuming "V2A" values are in A1:AE1 and COUNTIF formulas underneath i
A2:AE2 then at the bottom of your table, say row 10, in A10 put zero an
then in B10 copied across try this formula

=SUM(INDEX(1:1,IF(COUNTIF($A2:A2,""&B2),LOOKUP(2 ,1/($A2:A2B2),COLUMN($A2:A2)))+1):B1)-B

--
barry houdin


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Formula until condition met

Hi Barry,

Your formula ends with "-B" Is that correct? As opposed to "-B" with a number
as in "-B1"?

Appreciate the help.

barry houdini wrote:
Hello GBExcel, Not sure what happens when the values are equal.....bu
assuming "V2A" values are in A1:AE1 and COUNTIF formulas underneath i
A2:AE2 then at the bottom of your table, say row 10, in A10 put zero an
then in B10 copied across try this formula

=SUM(INDEX(1:1,IF(COUNTIF($A2:A2,""&B2),LOOKUP(2 ,1/($A2:A2B2),COLUMN($A2:A2)))+1):B1)-B

--
barry houdin


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Condition formula Herb Excel Discussion (Misc queries) 2 April 1st 09 12:07 AM
Please Help Again-Condition Formula Kareinia Excel Worksheet Functions 5 March 6th 08 08:06 PM
MORE THAN ONE CONDITION IN A FORMULA CLM Excel Worksheet Functions 5 January 18th 07 01:21 PM
If formula and #N/A as a condition EstherJ Excel Discussion (Misc queries) 2 August 23rd 05 02:52 PM
Add condition to formula Pat Excel Worksheet Functions 0 November 16th 04 12:23 PM


All times are GMT +1. The time now is 07:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"