+ Reply to Thread
Results 1 to 7 of 7

summarising categories in single column

  1. #1
    Registered User
    Join Date
    07-12-2017
    Location
    Australia
    MS-Off Ver
    Pro Plus 10
    Posts
    9

    summarising categories in single column

    Hi,

    I'm not even sure the correct terminology to use to explain, but here goes.
    I have 10 species recorded across 8 grids - some as historic records (H) and some as recent records (R). I'm trying to simply summarise whether they were recorded "H", "R" or "H, R" at the whole site (of 8 grids).

    I've used countif to get just "H" (see example in spreadsheet), but tried to multiplex countif to do "R" and "H, R" and failed dismally. For my brain, I guess I could do three columns - one for H, one for R and then concatenate. However, this example is just one site and I have many many sites (of multiple grids) to deal with and adding 3 columns everywhere will get messy very quickly. I also have some 1500 species.

    I'm sure it is straight forward and the brains trust here will be all over it. Thanks for your anticipated help.

    fishy
    Attached Files Attached Files
    Last edited by Mr fish; 06-13-2018 at 11:18 PM.

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,891

    Re: summarising categories in single column

    Try:

    =IF((COUNTIF(B2:I2,"H")>0)+(COUNTIF(B2:I2,"R")>0)>1,"H, R",IF(COUNTIF(B2:I2,"H")>0,"H",IF(COUNTIF(B2:I2,"R")>0,"R","")))

  3. #3
    Registered User
    Join Date
    07-12-2017
    Location
    Australia
    MS-Off Ver
    Pro Plus 10
    Posts
    9

    Re: summarising categories in single column

    That is great - thanks so much!

    for the record, I just realised that some of the cells had H, R, so I added to your equation and to my surprise, I got it right :-)
    =IF((COUNTIF(B2:I2,"H")>0)+(COUNTIF(B2:I2,"R")>0)>1,"H, R",IF(COUNTIF(B2:I2,"H")>0,"H",IF(COUNTIF(B2:I2,"R")>0,"R",IF(COUNTIF(B2:I2,"H, R")>0,"H, R",""))))

    Thanks again Phuocam

  4. #4
    Registered User
    Join Date
    07-12-2017
    Location
    Australia
    MS-Off Ver
    Pro Plus 10
    Posts
    9

    Re: summarising categories in single column

    Back again,

    I just realised that the formula I modified from Phuocam isn't counting 'H, R' when a single 'H' or 'R' is also in the row. Can anyone see what I have done wrong?

    Thanks again
    Attached Files Attached Files

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,904

    Re: summarising categories in single column

    j2=IF(SUMPRODUCT((COUNTIF(B2:I2,{"H*","*R"})>0)+0)>1,"H, R",IF(COUNTIF(B2:I2,"H"),"H",IF(COUNTIF(B2:I2,"R"),"R","")))
    Try this and copy towards down
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,409

    Re: summarising categories in single column

    Use one of below 2 options in J2:
    Please Login or Register  to view this content.
    Or:
    Please Login or Register  to view this content.
    Both options are array formula, must be confirmed by combination of Ctrl-Shift-Enter.
    Drag down
    Quang PT

  7. #7
    Registered User
    Join Date
    07-12-2017
    Location
    Australia
    MS-Off Ver
    Pro Plus 10
    Posts
    9

    Re: summarising categories in single column

    Thanks nflsales and bebo. all the options seem to work. This forum is very cool!

+ 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. Replies: 0
    Last Post: 11-24-2014, 12:52 PM
  2. Replies: 1
    Last Post: 11-05-2013, 11:22 AM
  3. Replies: 1
    Last Post: 05-15-2013, 06:55 AM
  4. Replies: 0
    Last Post: 02-15-2013, 01:59 PM
  5. Replies: 0
    Last Post: 07-22-2011, 03:51 PM
  6. Categories and Sub-Categories in Column Charts
    By theoneness in forum Excel General
    Replies: 2
    Last Post: 11-28-2009, 10:05 PM
  7. [SOLVED] Summarising a column of numbers
    By Keith in forum Excel General
    Replies: 3
    Last Post: 07-04-2006, 11: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