+ Reply to Thread
Results 1 to 8 of 8

Formula to compute short form from long form, but need to calculate average values first

  1. #1
    Registered User
    Join Date
    04-08-2012
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    18

    Formula to compute short form from long form, but need to calculate average values first

    Hello,

    I have a problem that has stumped me. I would be eternally grateful if someone could help me. I have attached a spreadsheet with a sample of the original data and the solution for which I am hoping to get a formula.

    Problem: Averages, sums, and variances need to be calculated and then long form data needs to be collapsed into short form for each expedition. Therefore, I need to calculate the following:
    1. average harmony for each expedition
    2. sum of “leader” values for each expedition
    3. sum of “injury” values for each expedition
    4. average age for each expedition
    5. variance of age for each expedition

    But here is the part I am struggling with: These new values need to be copied into a single row for each expedition. In other words, all the rows for a single expedition need to be collapsed into a single row for each expedition. I have over 50,000 rows of individual data that represent over 8,000 expeditions – that’s why I need a formula to do it for me.

    Thank you so much for your help!!! I REALLY appreciate it!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Re: Formula to compute short form from long form, but need to calculate average values fir

    good evening
    Let me return the file with line 19-20 in yellow in the formulas to find the desired results.
    For the variance in F17-F18 are not very handy with these formulas I made ​​a diagram H2: K11 for the calculation and the
    totals are different from yours.
    I do not know which formula to use.
    Sample data.xlsx

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Formula to compute short form from long form, but need to calculate average values fir

    Hi and welcome to the forum

    For the average calc columns, copy this down (and across to where you need it)...
    =AVERAGEIF($A$2:$A$11,$A17,B$2:B$11)

    For the sum calc columns, copy this down (and across to where you need it)...
    =SUMIF($A$2:$A$11,$A17,C$2:C$11)

    Im not sure what you are doing in col F (48.64) ?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    04-08-2012
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Formula to compute short form from long form, but need to calculate average values fir

    Thank you so much, Berna11 and FDibbins!!! Your help is very much appreciated

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Formula to compute short form from long form, but need to calculate average values fir

    Happy to help, but what are you doing in F?

  6. #6
    Registered User
    Join Date
    04-08-2012
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Formula to compute short form from long form, but need to calculate average values fir

    I was trying to calculate the variance in age for each expedition. I used the "=VAR.P" formula. Is there a way for me to calculate this for all expeditions?

  7. #7
    Registered User
    Join Date
    03-14-2015
    Location
    Hamburg
    MS-Off Ver
    7
    Posts
    32

    Re: Formula to compute short form from long form, but need to calculate average values fir

    Hi there,

    I have a solution based upon a step in between - workaround - since there isn't a sort of var_if or sth else. However, with the help of an if in combination to offset, the figures have been calculated.
    PLease note, that I have set my array up and including to the grey row. If you want the enhance the list, just put the addtional data before that grey, and the formulas are still correctly in place. The only thing you have to do then: copy the if-formula in column H and I .... and things will be fine
    Attached Files Attached Files

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Formula to compute short form from long form, but need to calculate average values fir

    When you say "all the expeditions" do you mean all of each of the expeditions?
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    returns the results in the upload. It is an array-entered formula, entered in F17 and filled down.

    Array enter means the formula must be committed by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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