+ Reply to Thread
Results 1 to 11 of 11

Counting the same like data in on cell

  1. #1
    Registered User
    Join Date
    01-31-2015
    Location
    New York
    MS-Off Ver
    2007
    Posts
    19

    Counting the same like data in on cell

    I want to be able to count the number of times something shows up in cell. Would I use a countif function? I have attached a sample copy. In K2 it has the word Video in it. I want to be able to count video for that cell twice.
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Counting the same like data in on cell

    hi Alaska1. try:
    =(LEN([@Source])-LEN(SUBSTITUTE([@Source],"Video","")))/LEN("video")

    basically it means
    (length of original text minus length of original text without the word "video") divided by length of the word "video"
    so for K2 would be
    =(12-2)/5
    =2

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    01-31-2015
    Location
    New York
    MS-Off Ver
    2007
    Posts
    19

    Re: Counting the same like data in on cell

    Thank you for your reply. It did not work for me.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Counting the same like data in on cell

    It worked for me? It gave 2 for K2 and K46.

    What was your expected results?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    01-31-2015
    Location
    New York
    MS-Off Ver
    2007
    Posts
    19

    Re: Counting the same like data in on cell

    When I try to cut and paste the formula it is not work...it does not recognize @source.

    Thank you for your help.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Counting the same like data in on cell

    So create the formula for yourself...
    =(LEN(click-the-cell-ref)-LEN(SUBSTITUTE(click-the-cell-ref,"Video","")))/LEN("video")
    If you still have a problem, upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.

  7. #7
    Registered User
    Join Date
    01-31-2015
    Location
    New York
    MS-Off Ver
    2007
    Posts
    19

    Re: Counting the same like data in on cell

    I have attached a copy and cleaned it up. The formula is on the report tab. It is counting two video but there are four in
    that field. The Data is in a Table.

    Thank you for your help.
    Attached Files Attached Files

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Counting the same like data in on cell

    Copy the formula to L2 on Sheet1, not Report. I have changed it a little, it is the same formula, but I used a reference, insteasd of hard coding...
    =(LEN([@Source])-LEN(SUBSTITUTE([@Source],report!$C$2,"")))/LEN(report!$C$2)

    J
    K
    L
    1
    Theme3 Source Column1
    2
    Video
    Video
    2
    3
    0
    4
    Profile
    Slide
    0


    Then on Report, use this...
    =SUM(Sheet1!L:L)
    Last edited by FDibbins; 02-26-2015 at 01:50 AM.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Counting the same like data in on cell

    Had another look at this. If you just want to show the answer on Report and not do the calc in sheet1 for each row, put this in D3 in report...
    =SUMPRODUCT((LEN(Sheet1!$K2:K266)-LEN(SUBSTITUTE(Sheet1!$K2:K266,report!$C$2,"")))/LEN(report!$C$2))

  10. #10
    Registered User
    Join Date
    01-31-2015
    Location
    New York
    MS-Off Ver
    2007
    Posts
    19

    Re: Counting the same like data in on cell

    Thank you again for all your help. I tried the formula and it gave me 4. The only thing is the data is in a Table and I need it to be dynamic...which I can use the Table name.

    But I need it to read
    Video as a total for the column not by row.

    So a total at the bottom
    Video 4
    Slide 5

    I need a total for those fields. As if I was doing a countifs function. But that only picks up the category once in the cell not twice.

  11. #11
    Registered User
    Join Date
    01-31-2015
    Location
    New York
    MS-Off Ver
    2007
    Posts
    19

    Re: Counting the same like data in on cell

    Thank you for your help. I adjust the formula using sumproduct and it worked.

+ 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. Counting cell between data
    By AlbusD in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-20-2013, 02:51 PM
  2. Formula for counting date & cell data
    By excelbry in forum Excel General
    Replies: 4
    Last Post: 06-17-2011, 04:12 AM
  3. Counting data based on 2 different criteria and one dynamic cell
    By reynastus in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 08-05-2010, 06:27 PM
  4. Counting data to a certain criteria in another cell
    By drgogo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-22-2010, 05:11 AM
  5. COUNTING A CELL's DATA
    By koa786 in forum Excel General
    Replies: 11
    Last Post: 09-18-2008, 05:48 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