+ Reply to Thread
Results 1 to 3 of 3

Excel 2007 : generating "absence data"

  1. #1
    Registered User
    Join Date
    09-27-2010
    Location
    Newfoundland, Canada
    MS-Off Ver
    Excel 2007
    Posts
    1

    Question generating "absence data"

    I have a dataset describing the number of birds of different species observed at a number of sites:

    site_id, species, number_present
    1, a, 2
    1, b, 1
    1, c, 1
    2, x, 2
    2, y, 2
    3, z, 1

    What i'd like to do is create additional rows for each site indicating absence - i.e. that 0 of species x, y and z were observed at site 1.

    Is there a quick and easy way to do this (relative to manually creating rows..)?

    Thanks in advance for your help on my first post to this forum

  2. #2
    Valued Forum Contributor
    Join Date
    02-04-2009
    Location
    Texas
    MS-Off Ver
    Excel 2016
    Posts
    665

    Re: generating "absence data"

    One way (probably not the most efficient) Add a column in front that you can hide if you want. And a column for total birds seen (2 species A were observed, 10 total birds observed)
    a b c d e
    new column site species number total number of birds observed

    Assuming there is a header row (row1)
    a2 : =COUNTA($E$2:$E2)
    A3: =COUNTA($E$2:$E3) - you can drag to copy down the column

    Then you could set up the other rows using vlookups. If there are 3 sites:
    =if(countif($a$2:$a$100,1),vlookup(1,$A$2:$E$100,1,False),"")

    This would return the first Site that no birds showed - the next cell would read:
    =if(countif($a$2:$a$100,2),vlookup(2,$A$2:$E$100,1,False),"")
    This would return the second site that no birds showed.
    AS LONG AS there is one entry for that site i.e.:
    1,none,0,0
    2,a,5,10
    2,b,1,10
    2,v,4,10
    3,nane,0,0

    with the hidden column shown:
    1,1,none,0,0
    0,2,a,5,10
    0,2,b,1,10
    0,2,v,4,10
    2,3,none,0,0

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: generating "absence data"

    I don't know the significance of having the new rows per se...

    Attached (XL2007 format) would be one way of generating a matrix of results for species/site combinations which may/may not be of interest.
    Attached Files Attached Files

+ 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