+ Reply to Thread
Results 1 to 7 of 7

Complex STANDARDIZE function related to SD with arguments

  1. #1
    Registered User
    Join Date
    09-14-2016
    Location
    Tirol
    MS-Off Ver
    Excel 2013
    Posts
    28

    Complex STANDARDIZE function related to SD with arguments

    Hey there!

    I have a little problem. I'm trying to calculate to a z-score where the AVERAGE and SD are linked to certain arguments. I want to figure out the z-score for instance for Name "A" in Session "X". I could calculate the average for A during session X but I'm struggeling to do the same for the standard deviation and put it into a STANDARDIZE formula. Help would be highly appreciated. Maybe a Macro could help.

    I've attached the file...
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Complex STANDARDIZE function related to SD with arguments

    The sample workbook is of next to no use. Please provide one with at least 10-15 rows of sample data with expected outcomes (not failing formulae) manually entered. Explain the logic behind the expected results in WORDS.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    09-14-2016
    Location
    Tirol
    MS-Off Ver
    Excel 2013
    Posts
    28

    Re: Complex STANDARDIZE function related to SD with arguments

    Hi!

    The file has 49 rows of data though...

    I expect a z-score in Column J based on the formula Standardize. Outcome values are usually between -3 and 3.
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Complex STANDARDIZE function related to SD with arguments

    You have not done what I asked.

    This is still completely devoid of the manually calculated results I asked for and there is no explanation of the logic you are using. You need to explain what you want the formula to do. Try again, please.

    Excel 2016 (Windows) 32 bit
    J
    1
    Z-SCORE IND V1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    Sheet: Workload Data

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Complex STANDARDIZE function related to SD with arguments

    Here's how I think I would do it -- recognizing that there will be multiple possible approaches:

    1) Use a pivot table to compute average and standard deviation for each name/session combination. Can I assume you are already familiar with Excel's pivot tables (https://www.excel-easy.com/data-****...ot-tables.html )
    2) Use lookup functions [INDEX(pivot table,MATCH(...))] inside of the STANDARDIZE() function to get the average and standard deviation from the pivot table. INDEX() function: https://support.office.com/en-us/art...2-b56b061328bd MATCH() function: https://support.office.com/en-us/art...9-533f4a37673a

    One caution -- I know we are often enamored of complex array functions that do everything at once. In this case, I would advise against a single cell mega-formula for this, because each copy of the formula will need to compute the average and standard deviation which potentially leads to the spreadsheet repeatedly performing the exact same calculation. I see significant value in keeping the average and standard deviation calculation separate from the standardize calculation to avoid unnecessary computer effort (which potentially slows down the spreadsheet).
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Registered User
    Join Date
    09-14-2016
    Location
    Tirol
    MS-Off Ver
    Excel 2013
    Posts
    28

    Re: Complex STANDARDIZE function related to SD with arguments

    Ok got it. The problem is my solution to the formula is not suitable or results in an error.

    I want the formula to take based on Name "A" and Session Type "Y" to take the value of cell D2. From D2 the value of the cell E2 should be substracted. E2 is represents the average values from Column D based on the Name (in this example A) and the session type (in this example Y). The new value (D2-E2) should afterwards be divided by the standard deviation (Column F2 ; based on Name ("A") and the session type ("Y"). I am looking now for an equilavent to AVERAGEIFS for STDEV where I can add argument for STDEV to the calculation.

    What I am basically looking for is how to add arguments to the formula STDEV in column F.
    Attached Files Attached Files

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,002

    Re: Complex STANDARDIZE function related to SD with arguments

    use this array formula:
    =STDEV(IF([Session Type]=[@[Session Type]],IF([Name]=[@Name],[V1])))

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...

    You may need ; instead of ,
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

+ 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] Nesting Complex IF Arguments
    By fearonc in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-07-2018, 06:22 PM
  2. [SOLVED] Complex Question, May be Related to VLookUp or Max? Selecting Most Recent Date/Status
    By jet05c in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-18-2018, 06:56 PM
  3. Replies: 2
    Last Post: 01-14-2016, 11:25 AM
  4. [SOLVED] very complex problem related to converting rows to column data
    By rde55cae in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-31-2015, 09:45 AM
  5. vlookup function to standardize names
    By bheltzel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-17-2011, 01:50 AM
  6. If Else (Related) Function
    By prem123 in forum Excel General
    Replies: 2
    Last Post: 09-22-2009, 01:41 PM
  7. Replies: 0
    Last Post: 06-20-2006, 10:55 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