+ Reply to Thread
Results 1 to 7 of 7

average and vlookup

  1. #1
    Forum Contributor
    Join Date
    08-17-2009
    Location
    West Midlands
    MS-Off Ver
    Excel 2016
    Posts
    213

    average and vlookup

    Hi All

    Apologies first off - but I can't upload a sample worksheet due to my company's security settings, so I'll try to explain what I need...

    I have a list of categories in A5:A20 - these are A,B,C,D etc... etc... In B5:B20 are numeric values 1,3,5,7 etc... etc... This is my lookup table.

    Additionally, I have a chart with monthly headers F4:Q4. Under F4 I have 20 values A,C,F,B,A,D etc... (F5:F24).

    What I need

    I'd like a formula that looks up all of the values F5:F24 in my lookup table and returns the average of the total sum.

    I realise I could use a helper column to do the lookups but I have multiple months to apply this to and don't want to double the amount of columns.

    Any help gratefully received.

    SAA

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: average and vlookup

    hi SAA. since you can't upload a file, it's hard to guess. but assuming if you have F5:F10 as your stated eg, your values would be:
    (1+5+11+3+1+7)/6?
    assuming A=1, B=3, C=5, D=7, E=9, F=11

    if that's the case, then try this array formula:
    =AVERAGE(LOOKUP(F5:F24,A5:A20,B5:B20))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    Attached Files Attached Files
    Last edited by benishiryo; 11-26-2013 at 09:09 AM. Reason: attached file

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Contributor
    Join Date
    08-17-2009
    Location
    West Midlands
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: average and vlookup

    benishiryo - thank you for taking the time to respond. The array formula you have posted returns a #N/A error.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: average and vlookup

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Forum Contributor
    Join Date
    08-17-2009
    Location
    West Midlands
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: average and vlookup

    benishiryo - your spreadsheet is set out exactly as mine. I've noticed that if any of the values in column F are deleted then the #N/A error occurs. This is why it's failing for me. In some instances there may be blanks.

    SAA

  6. #6
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: average and vlookup

    add an IFERROR

    =AVERAGE(IFERROR(LOOKUP(F5:F24,A5:A20,B5:B20),""))

  7. #7
    Forum Contributor
    Join Date
    08-17-2009
    Location
    West Midlands
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: average and vlookup

    Right then. I've figured it out - the following formula works for me:

    =SUMPRODUCT(SUMIF($A$5:$A$20,E5:E24,$B$5:$B$20))/COUNTIF(E5:E24,"<A")

    SAA

+ 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. Using vlookup with sum/average
    By city in forum Excel General
    Replies: 10
    Last Post: 12-01-2011, 12:01 PM
  2. Average + vlookup?
    By ABSTRAKTUS in forum Excel General
    Replies: 8
    Last Post: 06-21-2011, 05:06 PM
  3. Vlookup and average
    By mabuhanu in forum Excel General
    Replies: 5
    Last Post: 10-07-2009, 01:56 PM
  4. average and vlookup
    By noobnxcl in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-09-2008, 11:00 PM
  5. IF, VLookup & Average
    By KRISAM in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-18-2008, 05:16 AM

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