+ Reply to Thread
Results 1 to 14 of 14

Using Table Names in Average Formula Using Unconventional format

  1. #1
    Forum Contributor
    Join Date
    10-19-2016
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    226

    Using Table Names in Average Formula Using Unconventional format

    Hi, All.


    I have attached some dummy data, which I need some help with on two sections of the spreadsheet, please.


    Section 1

    I have 3 Results Tabs, which contain data and are averaged in cells (column M).

    At the moment, the Tracking Tab uses ranges to extract the data from the Results Tabs.

    I would like the formulas in F12:F14 to use the corresponding Table Names instead of ranges.

    Can anyone suggest a formula that would work using table names?



    Section 2

    In each of the 3 Results Tabs, the formula in I2:K4 use data ranges to find the average of the data for a particular Year (2016-2017, 2017-2018, 2018-2019).

    Is there a way to get the same results using a LOOKUP function instead of a data range or will I need to stick with data ranges because of the unconventional format (eg 6/11, which equates to 6 Years/11 Months).



    Many thanks for looking.
    Attached Files Attached Files

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Using Table Names in Average Formula Using Unconventional format

    In O365, the following works for F12:

    Please Login or Register  to view this content.
    Don't know whether that will work in your version or not. For the second part, things would be easier in O365 but the format of your data is not helping and I can't think of a way to simplify without using helper columns.

    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Forum Contributor
    Join Date
    10-19-2016
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    226

    Re: Using Table Names in Average Formula Using Unconventional format

    Hi, WideBoyDixon,

    Yes, that formula works perfectly in my version of Excel as well!!!!

    That's section 1 sorted with the suggestion you gave me.

    Many thanks!

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Using Table Names in Average Formula Using Unconventional format

    Please try

    1 F12
    =VLOOKUP(D12,INDIRECT("Table"&6+C12&"[[Year]:[Average]]"),7,)

    2 I2
    =SUBSTITUTE(TEXT(SUMPRODUCT(MID(SUBSTITUTE(C$2:C$51,"/"," "),{1,4},3)*{12,1}*($B$2:$B$51=$G2))/12/COUNTIFS($B$2:$B$51,$G2),"0\/0/12"),"/12",)
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    10-19-2016
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    226

    Re: Using Table Names in Average Formula Using Unconventional format

    Hi, Bo_Ry.

    Both of these formula suggestions also work perfectly.

    Many thanks for your input!!!

  6. #6
    Forum Contributor
    Join Date
    10-19-2016
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    226

    Re: Using Table Names in Average Formula Using Unconventional format

    Hi, Bo_Ry.

    I have come across a problem that I hope you can suggest a workaround for.

    In the dummy data I provided, there were no blank cells but in the data I have, there are blank cells.

    When I use the formula that you suggested for Section 2:

    =SUBSTITUTE(TEXT(SUMPRODUCT(MID(SUBSTITUTE(C$2:C$51,"/"," "),{1,4},3)*{12,1}*($B$2:$B$51=$G2))/12/COUNTIFS($B$2:$B$51,$G2),"0\/0/12"),"/12",)

    it works but only when there are no empty cells.

    I have included the sample file with blank cells so you can see what I mean.

    Thanks for looking.
    Attached Files Attached Files

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Using Table Names in Average Formula Using Unconventional format

    Please try at I2

    =SUBSTITUTE(TEXT(SUMPRODUCT(TEXT(MID(SUBSTITUTE(C$2:C$51,"/"," "),{1,4},3),"0;;0;\0")*{12,1}*($B$2:$B$51=$G2))/12/COUNTIFS($B$2:$B$51,$G2,C$2:C$51,"<>"),"0\/0/12"),"/12",)
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    10-19-2016
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    226

    Re: Using Table Names in Average Formula Using Unconventional format

    Hi, Bo_Ry.

    That's great - the suggestion works efficiently in the dummy data.

    I'll transfer it over to my original data sheet and hopefully, it'll work just as well.

    Many thanks once again!

  9. #9
    Forum Contributor
    Join Date
    10-19-2016
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    226

    Re: Using Table Names in Average Formula Using Unconventional format

    Hi, Bo_Ry.

    I have used the formula you suggested and it works perfectly even when there are blank cells, which is great.

    I have come across another problem, where I am getting a #VALUE! error and I wondered if you could take a look, please?

    When I have any negative value in a cell, for example -5/8, I get this error.

    I have attached the same sample file with a couple of negative values in the Results 1 Tab.

    Many thanks for looking.
    Attached Files Attached Files
    Last edited by cosmica67; 08-15-2022 at 04:55 AM.

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,657

    Re: Using Table Names in Average Formula Using Unconventional format

    This proposal employs four helper columns.
    Columns E and G display the years using: =IF(C2="","",LEFT(C2,SEARCH("/",C2)-1)+0)
    Columns F and H display the months using: =IF(C2="","",RIGHT(C2,LEN(C2)-SEARCH("/",C2))+0)
    The columns for September and March averages are populated using: =ROUND(AVERAGEIFS(Table1[Sept Yrs],Table1[Year],K2),0)&"/"&ROUND(AVERAGEIFS(Table1[Sept Mos],Table1[Year],K2),0)
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  11. #11
    Forum Contributor
    Join Date
    10-19-2016
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    226

    Re: Using Table Names in Average Formula Using Unconventional format

    Hi, JeteMc.

    Many thanks for your suggestion, which I have now had time to digest and get my head around.

    Using the four helper columns certainly seems to fix the error message I was getting when there are any negative numbers, so this is great.

    With the average data (column Q) is there any way that the ranges in the formula can be changed to use table names instead or is there a reason for using these ranges?

    Thanks for looking.

  12. #12
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,657

    Re: Using Table Names in Average Formula Using Unconventional format

    It appears that Bo_Ry's array formula** in column Q can be rewritten using table names (aka. structured references):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    This regular formula produces the same results as those shown in column Q:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Last edited by JeteMc; 08-31-2022 at 10:05 PM. Reason: Added second formula

  13. #13
    Forum Contributor
    Join Date
    10-19-2016
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    226

    Re: Using Table Names in Average Formula Using Unconventional format

    Hi, JeteMc.

    This is exactly what I was looking for.

    Many thanks for your input and tweaking what Bo_Ry initially suggested.

    Regards.

  14. #14
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,657

    Re: Using Table Names in Average Formula Using Unconventional format

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

+ 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] Average Formula for unconventional Data
    By cosmica67 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-15-2022, 11:43 AM
  2. Excel Bar Chart Using Unconventional Data
    By cosmica67 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 12-24-2021, 07:39 AM
  3. [SOLVED] Average Formula Using Unconventional format
    By cosmica67 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 12-23-2021, 10:34 PM
  4. [SOLVED] Pivot table truncate format for average percentage
    By misty15 in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 11-12-2019, 09:19 AM
  5. [SOLVED] formula to get the average scores per distinct names
    By albert28 in forum Excel General
    Replies: 2
    Last Post: 02-03-2014, 02:33 AM
  6. Converting unconventional time formats.
    By jollyfarmertom in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-16-2012, 07:04 AM
  7. Assessing unconventional projects
    By khwaja in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-29-2006, 11:55 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