+ Reply to Thread
Results 1 to 11 of 11

Averaging VLOOKUPs dynamically.

  1. #1
    Registered User
    Join Date
    11-16-2017
    Location
    Ohio, United states
    MS-Off Ver
    2013
    Posts
    41

    Averaging VLOOKUPs dynamically.

    Good Afternoon everyone!

    So, I have a spread sheet that has hundreds of rows of data arranged like they are in the example book. As you can see some have one piece of data, and others as many as four. As an output in column K, i can do a vlookup on B4, and then divide C4 by that number to get me a days on hand of the part in column B. It works perfectly every time. The problem is, if there are more than one set of data there i need to average them and i cant get that to happen dynamically. If i drag the formula down wards i will get the N/A error because if im averaging based on having 4 sets of data, then if that formula is applied to say, row 4 then E4, G4, and H4 have no data. does that make sense? if there's only one set of data its no problem. in fact its no problem for any of them if i want to manually change the formula for every row based on the number of inputs. The problem with that is there are about 531 rows with different amounts of data and also it will change every month or so....i'm at a total loss here haha. Im not sure if i explained that well enough either so please let me know. I need C4/V4 (which is an output from a vlookup). for row 5 i would need ((C5/B5)+(E5/D5))/2 to get the average and so one for 3 and four sets. I've ever tried stringing IFEERROR and ifs together and it get so complicated so fast i cant even remember what I'm doing any more!

    Thank you all in advance for bearing with that entire paragraph, and any help you can give me

    Codemancode
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Averaging VLOOKUPs dynamically.

    Add the VLOOKUP table to your file so it is clear how this works.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Averaging VLOOKUPs dynamically.

    Or try

    =SUM((C5/VLOOKUPB4)+(E5/VLOOKUPD4)+(G5/VLOOKUPF4)+(I5/VLOOKUPH4))/(COUNTIF(B5:I5,"<>")/2)

  4. #4
    Registered User
    Join Date
    11-16-2017
    Location
    Ohio, United states
    MS-Off Ver
    2013
    Posts
    41

    Re: Averaging VLOOKUPs dynamically.

    The VLOOKUP is for average daily use. Basically it will return the average daily use of Apples in B4, and then C4, which is the number of apples in inventory will be divided for that so i have an idea of my days on hand of apples. The VLOOKUP table is about is like 20,000 rows, but i can include it if youd like...haha. Bascially my formula right now is SUM(P5/VLOOKUP($O5,ADU!A:D,4,FALSE)). "ADU" is the name of the tab that contains the ODBC server query data.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Averaging VLOOKUPs dynamically.

    A small sample of your VLOOKUP (10 or less rows) so we can test out solutions against your posted file..

    Thank you.

  6. #6
    Registered User
    Join Date
    11-16-2017
    Location
    Ohio, United states
    MS-Off Ver
    2013
    Posts
    41

    Re: Averaging VLOOKUPs dynamically.

    s the ADU tab added to the sheet
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Averaging VLOOKUPs dynamically.

    I assume "Apple" etc are replaced by "Part" from column A (of ADU) and VLOOKUP is returning column D (many of which are zero) so we have cater for #DIV/0 and VLOOKUP when there is no "part" in B,D,F or H
    ?????
    Adding a real example would (will) help!

  8. #8
    Registered User
    Join Date
    11-16-2017
    Location
    Ohio, United states
    MS-Off Ver
    2013
    Posts
    41

    Re: Averaging VLOOKUPs dynamically.

    Yes sir, sorry about that. apple would be a part number from A and it returns column D. DIV/0 isnt really a problem typically because most parts I forecast have a value other than 0 in column D. You see zero in the example tab because it lists EVERY part in our system automatically, even obsolete ones we dont use any more.

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Averaging VLOOKUPs dynamically.

    Try

    =(SUM(C7/VLOOKUP($B7,ADU!$A$2:$D$2000,4,0)+IFERROR($E7/VLOOKUP($D7,ADU!$A$2:$D$2000,4,0),0)+IFERROR($G7/VLOOKUP($F7,ADU!$A$2:$D$2000,4,0),0)+IFERROR($I7/VLOOKUP($H7,ADU!$A$2:$D$2000,4,0),0)))/(COUNTIF(B7:I7,"<>")/2)
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    11-16-2017
    Location
    Ohio, United states
    MS-Off Ver
    2013
    Posts
    41

    Re: Averaging VLOOKUPs dynamically.

    Apologies for the late response. That worked very well thanks! I have definitely learned a lot from asking stupid questions here lol.

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Averaging VLOOKUPs dynamically.

    Glad to helped.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Complicated averaging-- averaging data that matches certain intervals
    By atung in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 10-22-2014, 04:19 PM
  2. Replies: 0
    Last Post: 06-22-2014, 04:18 PM
  3. SUM VLOOKUPs
    By djones13 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-27-2011, 02:50 PM
  4. Vlookups
    By BSDScotty in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-19-2009, 06:23 AM
  5. vlookups
    By Mike0GW in forum Excel General
    Replies: 6
    Last Post: 12-17-2008, 09:09 PM
  6. [SOLVED] vlookups
    By T in forum Excel General
    Replies: 4
    Last Post: 05-13-2006, 07:15 AM
  7. Vlookups, IF's..and Oh No!
    By Shadez in forum Excel General
    Replies: 2
    Last Post: 11-29-2005, 01:15 AM

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