+ Reply to Thread
Results 1 to 6 of 6

Find the first value in a row and sum n columns

  1. #1

    Find the first value in a row and sum n columns

    Hello,
    Don't know if this easy or not.
    I am trying to write a formula that finds the 1st value in a column
    that is >0 and then sum that value and the next 4 columns across.
    For example my formula is in D2 and I want to find the 1st value to the
    right of the formula that is >1 and add up that value and the next 4
    values to the right of this

    Any help would be appreciated!

    Thanks

    Pete


  2. #2
    Biff
    Guest

    Re: Find the first value in a row and sum n columns

    Hi!

    One way:

    Entered as an array using the key combo of CTRL,SHIFT,ENTER:

    =SUM(OFFSET(D2,,MATCH(1,(ISNUMBER(E2:IV2))*(E2:IV2>0),0),,4))

    Adjust for the end of the range as needed.

    Biff

    <[email protected]> wrote in message
    news:[email protected]...
    > Hello,
    > Don't know if this easy or not.
    > I am trying to write a formula that finds the 1st value in a column
    > that is >0 and then sum that value and the next 4 columns across.
    > For example my formula is in D2 and I want to find the 1st value to the
    > right of the formula that is >1 and add up that value and the next 4
    > values to the right of this
    >
    > Any help would be appreciated!
    >
    > Thanks
    >
    > Pete
    >




  3. #3
    Biff
    Guest

    Re: Find the first value in a row and sum n columns

    Hmmm.....

    >that finds the 1st value in a column that is >0


    >find the 1st value to the right of the formula that is >1


    Well, which is it? <g>

    I wrote the formula to look for the first number greater than zero.

    Biff

    "Biff" <[email protected]> wrote in message
    news:[email protected]...
    > Hi!
    >
    > One way:
    >
    > Entered as an array using the key combo of CTRL,SHIFT,ENTER:
    >
    > =SUM(OFFSET(D2,,MATCH(1,(ISNUMBER(E2:IV2))*(E2:IV2>0),0),,4))
    >
    > Adjust for the end of the range as needed.
    >
    > Biff
    >
    > <[email protected]> wrote in message
    > news:[email protected]...
    >> Hello,
    >> Don't know if this easy or not.
    >> I am trying to write a formula that finds the 1st value in a column
    >> that is >0 and then sum that value and the next 4 columns across.
    >> For example my formula is in D2 and I want to find the 1st value to the
    >> right of the formula that is >1 and add up that value and the next 4
    >> values to the right of this
    >>
    >> Any help would be appreciated!
    >>
    >> Thanks
    >>
    >> Pete
    >>

    >
    >




  4. #4

    Re: Find the first value in a row and sum n columns

    Whoops, I meant greater than 0. Formula works fine! Thanks for your
    help

    Pete.


  5. #5
    Biff
    Guest

    Re: Find the first value in a row and sum n columns

    You're welcome. Thanks for the feedback!

    Biff

    <[email protected]> wrote in message
    news:[email protected]...
    > Whoops, I meant greater than 0. Formula works fine! Thanks for your
    > help
    >
    > Pete.
    >




  6. #6
    Forum Contributor
    Join Date
    02-19-2005
    Location
    Gurgaon,India
    MS-Off Ver
    2007,2010,2013
    Posts
    180
    Hi,

    Try,

    =SUM(INDEX($E$3:$I$3,0,MATCH(TRUE,$E$3:$I$3>0,0)):INDEX($E$3:$I$3,0,MATCH(TRUE,$E$3:$I$3>0,0)+3))

    Array entered.

    HTH
    Kris

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1