+ Reply to Thread
Results 1 to 6 of 6

find value corresponding to first across multiple groups

  1. #1
    Registered User
    Join Date
    02-13-2013
    Location
    Washington, DC
    MS-Off Ver
    Excel 2010
    Posts
    3

    find value corresponding to first across multiple groups

    Hi,

    please see my data file below: I am wanting to insert the baseline value (i.e. the first value in a group) for every entry of that group. E.g. AA would be 4.38, AE 3.61, AF 2.9, AG 4.27.

    I've tried pivot tables, and can calculate the max/min or average values within a group, but not the first.

    Any help most appreciated.

    THanks

    AA
    AA 4.38
    AA
    AE
    AE
    AE 3.61
    AE
    AE 4.7
    AE
    AF
    AF 2.9
    AF
    AF 2.69
    AF
    AF 2.53
    AF
    AF
    AF
    AG 4.27
    AG
    AG 5.85
    AG
    AG 2.04

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: find value corresponding to first across multiple groups

    Try these array formulas (Applied with Ctrl + Shift + Enter, instead of just Enter):

    Assuming AA, AE, AF, Ag are in column A, and values are in column B...

    To find AA: =INDEX($B$1:$B$23,MATCH(1,($A$1:$A$23="AA")*($B$1:$B$23>0),0))
    To find AE: =INDEX($B$1:$B$23,MATCH(1,($A$1:$A$23="AE")*($B$1:$B$23>0),0))
    To find AF: =INDEX($B$1:$B$23,MATCH(1,($A$1:$A$23="AF")*($B$1:$B$23>0),0))
    To find AG: =INDEX($B$1:$B$23,MATCH(1,($A$1:$A$23="AG")*($B$1:$B$23>0),0))

    - Moo

  3. #3
    Registered User
    Join Date
    02-13-2013
    Location
    Washington, DC
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: find value corresponding to first across multiple groups

    Thanks Moo,

    I have several dozen groups (AA-MF). Is there some way to do this where I don't have to explicitly state the group IDs?

  4. #4
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: find value corresponding to first across multiple groups

    Sure, make a list of the ID's in a column (vertically), for instance, if the list is in cell F1 and down, use this formula in G1 then fill down:

    =INDEX($B$1:$B$300,MATCH(1,($A$1:$A$300=F1)*($B$1:$B$300>0),0))

    Remember to apply with Ctrl + Shift + Enter.


    Be sure to change the 300 to however many rows of data are in your original data set.

    Then fill that formula down to the end of your list.

    - Moo
    Last edited by Moo the Dog; 02-13-2013 at 04:32 PM.

  5. #5
    Registered User
    Join Date
    02-13-2013
    Location
    Washington, DC
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: find value corresponding to first across multiple groups

    Moo you did it! Thanks so much this is perfect.
    Anna

  6. #6
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: find value corresponding to first across multiple groups

    Glad to help.

+ 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