+ Reply to Thread
Results 1 to 8 of 8

allocate values to specific rows

  1. #1
    Registered User
    Join Date
    07-04-2011
    Location
    Ghent, Belgium
    MS-Off Ver
    Excel 2003/2007
    Posts
    14

    allocate values to specific rows

    Hi all,

    I have 9 samples in which a number of species were found, but the number and kind of species vary between samples. Now I'd like to create a pivot table to have an overview of which species was found where and the amount of individuals in each sample. In order to create this pivot table, I need to gather information from different tables.
    Through applying filters I have made a column with every species found throughout the samples (unique values). Now I want to allocate the number of individuals of a certain species found in every sample to the corresponding row.

    I've used the lookup formula:
    =LOOKUP(A2;L$2:L$92;M$2:M$92)

    with A the column with the unique values
    L the column of a sample
    M the number of individuals

    This works only partly.
    Until it comes across a match, it gives N/A, which is ok, but when the first match is found, it gives the number of individuals of that specific match until the next match, and repeats this 'behaviour' for every match it encounters.

    How can I avoid this extrapolation of values?

    Thanks in advance!
    Last edited by furor; 07-06-2011 at 07:06 AM. Reason: solved

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: allocate values to specific rows

    post a workbook
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    07-04-2011
    Location
    Ghent, Belgium
    MS-Off Ver
    Excel 2003/2007
    Posts
    14

    Re: allocate values to specific rows

    Hi,

    I've included a portion of my data. I've highlighted 3 matches in yellow and the (wrongly) extrapolated values in red. The latter should be zero, #N/A or similar.

    Thanks
    Attached Files Attached Files

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: allocate values to specific rows

    use
    =INDEX($M$1:$M$36;MATCH(A2;$L$1:$L$36;0))

  5. #5
    Registered User
    Join Date
    07-04-2011
    Location
    Ghent, Belgium
    MS-Off Ver
    Excel 2003/2007
    Posts
    14

    Re: allocate values to specific rows

    This works fine, thanks!

    If I may add another, somewhat related problem?
    I want to get unique values from 2 joined columns and then retrieve the highest number when a species occurred in both columns.

    Using lookup, this works when the numbers are arranged from low to high, but there are exceptions (highlighted). To overcome this, I tried to combine lookup with match and max functions, but it didn't work out.

    Any ideas?



    (this might address another problem: for some reason I have problems with Excel 2007 occasionally not executing functions, filters, ... the way it should be)
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-04-2011
    Location
    Ghent, Belgium
    MS-Off Ver
    Excel 2003/2007
    Posts
    14

    Re: allocate values to specific rows

    Anybody?

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: allocate values to specific rows

    try for max in e3 put
    =MAX(($A$3:$A$79=D3)*($B$3:$C$79)) array entered with ctrl+shift+enter

  8. #8
    Registered User
    Join Date
    07-04-2011
    Location
    Ghent, Belgium
    MS-Off Ver
    Excel 2003/2007
    Posts
    14

    Re: allocate values to specific rows

    Super! Thanks!

+ 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