+ Reply to Thread
Results 1 to 10 of 10

Help with combining these two formulas VLOOKUP and AVERAGE

  1. #1
    Registered User
    Join Date
    08-14-2015
    Location
    London
    MS-Off Ver
    2011
    Posts
    9

    Help with combining these two formulas VLOOKUP and AVERAGE

    Hi I'm currently using a vlookup formula to find the value in a single sheet:

    =vlookup($A4,'Week 1'!$B:$E,3,0)

    i need to find the average value of the same formula but for four different sheets (Week 2, Week 3, Week4)

    rather than using four cells and using vlookup to find the value individually and then finding the average using =Average, is there a way of combining the two formulas into one cell.

    Thanks

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Help with combining these two formulas VLOOKUP and AVERAGE

    Maybe

    =AVERAGE(VLOOKUP(...),VLOOKUP(...),VLOOKUP(...),VLOOKUP(...))

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Help with combining these two formulas VLOOKUP and AVERAGE

    Well it's the same thing that you describe, it's just doing it all in one cell:

    =AVERAGE(IFERROR(vlookup($A4,'Week 1'!$B:$E,3,0),0),IFERROR(vlookup($A4,'Week 2'!$B:$E,3,0),0),IFERROR(vlookup($A4,'Week 3'!$B:$E,3,0),0),IFERROR(vlookup($A4,'Week 4'!$B:$E,3,0),0))

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    08-14-2015
    Location
    London
    MS-Off Ver
    2011
    Posts
    9

    Re: Help with combining these two formulas VLOOKUP and AVERAGE

    Well thats me put to shame.

    I'm sure i tried the exact same formula before i came on here as thats the obvious solution but i was getting an Error code.

    Now however after re-entering it, it works fine.

    Thanks for your help

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Help with combining these two formulas VLOOKUP and AVERAGE

    If you didn't wrap the IFERROR around the VLOOKUPs then you would have got an error result if any of them didn't find an exact match - mine just returns 0 in that case, and AVERAGE will ignore them.

    Hope this helps.

    Pete

  6. #6
    Registered User
    Join Date
    08-14-2015
    Location
    London
    MS-Off Ver
    2011
    Posts
    9

    Re: Help with combining these two formulas VLOOKUP and AVERAGE

    Ok so a quick problem that maybe an easy fix.

    lets just say the info we've looked up is: 100, 100, (no data found), 100

    how would i get this to read this as 100 rather than 75 (as it counts the sheet without data as 0)
    Last edited by kraser; 04-13-2016 at 09:02 PM.

  7. #7
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Help with combining these two formulas VLOOKUP and AVERAGE

    Quote Originally Posted by kraser View Post
    I'm sure i tried the exact same formula before i came on here as thats the obvious solution but i was getting an Error code.

    Now however after re-entering it, it works fine.
    Been there, done that, as I'm sure many other have as well

    To correct the average, try changing the iferror results from 0 to ""

  8. #8
    Registered User
    Join Date
    08-14-2015
    Location
    London
    MS-Off Ver
    2011
    Posts
    9

    Re: Help with combining these two formulas VLOOKUP and AVERAGE

    unfortunately i tried this and it come up with the error:

    function AVERAGE parameter 3 expects number values. But " is a text and cannot be coerced to a number

  9. #9
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Help with combining these two formulas VLOOKUP and AVERAGE

    This works for me, it just returns a #VALUE error if all 4 vlookups return N/A

    =AVERAGE(IFERROR(VLOOKUP($A4,'Week 1'!$B:$E,3,0),""),IFERROR(VLOOKUP($A4,'Week 2'!$B:$E,3,0),""),IFERROR(VLOOKUP($A4,'Week 3'!$B:$E,3,0),""),IFERROR(VLOOKUP($A4,'Week 4'!$B:$E,3,0),""))

  10. #10
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Help with combining these two formulas VLOOKUP and AVERAGE

    You could also do

    =SUM(all_those_vlookups) / COUNT(all_those_vlookups)

    where the IFERROR term returns "" instead of 0 when there is an error.

    Hope this helps.

    Pete

+ 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. [SOLVED] Question About Combining two Formulas to do a vlookup
    By JasonAhn in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-07-2015, 03:00 PM
  2. Combining vlookup formulas
    By Rain78 in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 08-18-2015, 01:30 PM
  3. [SOLVED] Combining Average and VLookup
    By Emma_SB in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-02-2014, 11:41 AM
  4. Replies: 10
    Last Post: 04-25-2013, 06:12 PM
  5. [SOLVED] need help to get average value by combining 4 data periodically
    By deche in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-17-2013, 05:56 AM
  6. Vlookup / If combining formulas
    By ppines in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-21-2011, 07:10 AM
  7. combining IF and VLookup formulas
    By bby2 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-14-2008, 03:29 PM

Tags for this Thread

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