+ Reply to Thread
Results 1 to 6 of 6

Formula to find first +ve number and give the average

  1. #1
    Registered User
    Join Date
    08-11-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    93

    Formula to find first +ve number and give the average

    Hello -

    I want excel to perform following by formula.

    I have set of numbers in one column. There are some dates where the count is 0 so excel to find out the next positive number and take an average of the cells from 0 until next positive number and provide it in next column

    Date Planned Desired Plan
    1-Aug-19 0 40
    2-Aug-19 80 40
    5-Aug-19 0 30
    6-Aug-19 0 30
    7-Aug-19 90 30
    8-Aug-19 0 20
    9-Aug-19 0 20
    12-Aug-19 60 20
    13-Aug-19 0 25
    14-Aug-19 50 25
    Last edited by sandiptemkar; 09-09-2019 at 07:58 AM.

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,910

    Re: Formula to find first +ve number and give the average

    Try this in C2:

    =IF(AND(B2=0,B1<>0),INDEX(B2:$B$11,MATCH(TRUE,INDEX(B2:$B$11<>0,0),0))/MATCH(TRUE,INDEX(B2:$B$11<>0,0),0),C1)

  3. #3
    Registered User
    Join Date
    08-11-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Formula to find first +ve number and give the average

    OMG --- What a formula --- it worked nicely --- thanks much --- outstanding -- my query got resolved. Added reputation.
    Last edited by sandiptemkar; 09-09-2019 at 08:20 AM.

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,910

    Re: Formula to find first +ve number and give the average

    See the attached file.

  5. #5
    Registered User
    Join Date
    08-11-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Formula to find first +ve number and give the average

    Yes Phuocam - I have updated my reply -- It worked --- I had considered some other columns -- thanks -- query has resolved.

  6. #6
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,910

    Re: Formula to find first +ve number and give the average

    You are welcome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Find duplicate values and give them a matching number
    By chrisellis250 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-01-2019, 09:19 AM
  2. Replies: 1
    Last Post: 04-14-2016, 05:46 AM
  3. [SOLVED] Formula to give Row number
    By rizmomin in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-27-2014, 12:02 PM
  4. Need Excel formula that will give me a monthly average
    By mburke in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-20-2013, 09:23 AM
  5. [SOLVED] Find Average, Return Column Header of Number Closest To Average
    By djmyers in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-07-2013, 04:19 PM
  6. [SOLVED] Formula to give an average time for month
    By davechamp1983 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 12-20-2012, 08:51 PM
  7. [SOLVED] how to find numbers that give another number
    By Rossella in forum Excel General
    Replies: 1
    Last Post: 04-19-2006, 01:00 PM

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