+ Reply to Thread
Results 1 to 4 of 4

Thread: How to count and add specific cells

  1. #1
    Registered User
    Join Date
    06-15-2011
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    6

    How to count and add specific cells

    hello everyone, im been searching the net for quite some time now, and im having a hard time, to find someone with a similar problem, maybe because i really dont know what the problem is specifically so I dont know what to ask or search for, so i decided to join this forum and attach a file thats been bugging mo for a while now. so pls see the attached file.

    okay, what I want to happen is to add the piglets with the same mother and display it at the last cell in the litter size column. so in this case, w-2822 has 6 piglets, so i want to display it on E7 the number 6 and display on G7 how many male and female piglets does it have, so in this case 3/3. how do i do it to automatically make them show up cause i have thousands of this and i dont want to keep counting. and how do i get, like a divider for every different mother so its more easy to see. thx and godbless. pls ask me if you dont understand my problem.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    06-15-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: How to count and add specific cells

    I would probably use "COUNTIF" For W-2822 example, use "A2:A7" for the range, and "W-2822" as the criteria. For the male/female, split between columns and use the countif function again. Hope that helps.

  3. #3
    Valued Forum Contributor Haseeb A's Avatar
    Join Date
    05-24-2011
    Location
    India | Kwt
    MS-Off Ver
    2007
    Posts
    1,447

    Re: How to count and add specific cells

    Hello, mr_anpablo

    Try these;

    E2, copy down.

    =IF(A2<>A3,COUNTIF(A$2:A2,A2),"")

    G2, copy down.

    IF(N(E2),COUNTIF(INDEX(F:F,MATCH(A2,A:A,0)):F2,"M")&"/"&COUNTIF(INDEX(F:F,MATCH(A2,A:A,0)):F2,"F"),"")

    Assume MOTHERs are grouped together.
    HTH; Haseeb

    If your problem is solved, please say so clearly, and mark your thread as Solved:
    Forum Rules & How to Mark a thread as SOLVED

  4. #4
    Registered User
    Join Date
    06-15-2011
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How to count and add specific cells

    hey, i havent got the chance to say thanks to both of you.. thanks a lot for the help. it both perfectly worked.. thx

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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.2.0