+ Reply to Thread
Results 1 to 5 of 5

Adjust this formula to count the first 3 columns rather than the last 3?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-29-2012
    Location
    usa
    MS-Off Ver
    Excel 2016
    Posts
    325

    Adjust this formula to count the first 3 columns rather than the last 3?

    Ok, so I found this formula online, and have adjusted it to fit my needs and it works generally.

    =AVERAGE(INDEX(L6:FZ6,LARGE(IF(L6:FZ6<>"",COLUMN(L6:FZ6)-COLUMN(L6)+1),3)):FZ6)

    However, the formula calculates the average of the LAST 3 non-blank columns. I would like the formula to calculate the average of the FIRST 3 non-blank columns starting with column L. Any ideas?

    Thank you all in advance.

  2. #2
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Adjust this formula to count the first 3 columns rather than the last 3?

    Without seeing how your data is setup, what does this return?

    =AVERAGE(INDEX(L6:FZ6,SMALL(IF(L6:FZ6<>"",COLUMN(L6:FZ6)-COLUMN(L6)+1),3)):FZ6)
    Spread the love, add to the Rep

    "None of us are as smart as all of us."

  3. #3
    Forum Contributor
    Join Date
    12-29-2012
    Location
    usa
    MS-Off Ver
    Excel 2016
    Posts
    325

    Re: Adjust this formula to count the first 3 columns rather than the last 3?

    Quote Originally Posted by mcmahobt View Post
    Without seeing how your data is setup, what does this return?

    =AVERAGE(INDEX(L6:FZ6,SMALL(IF(L6:FZ6<>"",COLUMN(L6:FZ6)-COLUMN(L6)+1),3)):FZ6)
    It seems like it is taking the average of the LAST 4 non-blank cells for some reason?

  4. #4
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Adjust this formula to count the first 3 columns rather than the last 3?

    Try this, entered with CSE:

    =AVERAGE(OFFSET($L$6,,,,SMALL(IF($L$6:$FZ$6<>"",COLUMN($L$6:$FZ$6)-COLUMN($L$6)+1),3)))

  5. #5
    Forum Contributor
    Join Date
    12-29-2012
    Location
    usa
    MS-Off Ver
    Excel 2016
    Posts
    325

    Re: Adjust this formula to count the first 3 columns rather than the last 3?

    Quote Originally Posted by mcmahobt View Post
    Try this, entered with CSE:

    =AVERAGE(OFFSET($L$6,,,,SMALL(IF($L$6:$FZ$6<>"",COLUMN($L$6:$FZ$6)-COLUMN($L$6)+1),3)))
    Nailed it. Greatly appreciate the help!

+ 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. How to get excel to automatically adjust a =SUM(…:…)/COUNT(…:…) formula
    By Owen Keating in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-03-2014, 10:09 PM
  2. [SOLVED] Columns of Data move position - how to get formula to adjust?
    By andrewc in forum Excel General
    Replies: 9
    Last Post: 02-28-2014, 12:33 PM
  3. Adjust a macro to copy 2 columns instead of one
    By dreddster in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-13-2013, 04:58 PM
  4. Macro to adjust values in columns
    By additude in forum Excel Programming / VBA / Macros
    Replies: 34
    Last Post: 11-06-2007, 03:07 PM
  5. [SOLVED] auto adjust columns in a pivot
    By jenn in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 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