+ Reply to Thread
Results 1 to 31 of 31

Formula to count text/word in multiple sheets

  1. #1
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Lightbulb Formula to count text/word in multiple sheets

    Hi all,

    I have a formula that calculates the amount of times the word appears on a sheet but now my problem is to include different sheets to get the total. My Sheets are renamed.

    Basically i have a main data sheet and the rest of the sheets are various names with data on but i need to see how many times that word/text is used. Not sure if i have to name the sheets also to show in the Name Box?

    My formula i have is as follows:

    =COUNTIF(A1:A1000,A2)

    I need to include say for example the following sheet names so it adds it all together :

    Week Days
    Month
    Days

    I have a formula I found on excel-easy.com but it give me an error:

    =COUNTIF(Days!A1:A1000,D2)+COUNTIF(Month!A2:A6,D2)+COUNTIF(Week Days!A2:A6,D2)

    Thanks in advance for any help

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Formula to count text/word in multiple sheets

    You need to put ' around sheet names if contain blanks:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Re: Formula to count text/word in multiple sheets

    Hi zbor,

    Thank you for the reply and suggestion, i changed it to your formula but now i am getting 0 as result.
    Maybe i am doing the criteria wrong.

    I tried to load the excel sheet but does not load so i attached images for you to understand better.


    Sheet 1 tab.JPG SHEET 1

    Sheet 2 tab.JPG SHEET 2

    Sheet 3 tab.JPG SHEET 3

    Data tab.JPG DATA SHEET


    Kind Regards

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Formula to count text/word in multiple sheets

    You are not covering proper ranges.

    Write this in B1 of DATA SHEET and extend down:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Re: Formula to count text/word in multiple sheets

    It is only giving me a 0 in B1 for all the rows down.

    If i put this formula in on the data sheet =COUNTIF(A1:A1000,A1) and extended down I get the answer 1 which is correct as there is only one listed of each word.

    But when i try to add all the other sheets like the previous formula it does give me a result, well i get 0 but there the words are on the other sheets.

    sorry for being a pain

    Regards

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Formula to count text/word in multiple sheets

    Wait, what?

    =COUNTIF(A1:A1000,A1) is looking in THAT sheet. Not other sheets.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need.
    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  7. #7
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Re: Formula to count text/word in multiple sheets

    I was just showing that formula calculates what i need but when i need to
    incorporate the additional sheets it does not give me a total.

    Regards
    Attached Files Attached Files

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Formula to count text/word in multiple sheets

    So for word Excel formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    returns 24.

    What is your expected result?

  9. #9
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Re: Formula to count text/word in multiple sheets

    Hi,

    Thanks that works exactly the way i want but somehow when i incorporate that into my original it does not calculate the words, it returns 0 for all the rows.

    I have altered the original just for you to see, i'm sure it has to do with the sheet names,

    your help is appreciated.
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,253

    Re: Formula to count text/word in multiple sheets

    COUNTIF expects an EXACT match: your words are embedded in other text.

    TRY

    =SUMPRODUCT(--ISNUMBER(SEARCH(A2,Curry!$A$1:$C$1000)))+SUMPRODUCT(--ISNUMBER(SEARCH(A2,Chilli!$A$1:$C$1000)))+SUMPRODUCT(--ISNUMBER(SEARCH(A2,'Blends & Mixes'!$A$1:$C$1000)))


    Enter with Ctrl+Shift+Enter

    And DESCRIPTIONs in DATA need to match those in your sheets e.g." GROUND PEPPER" not "GROUND - PEPPER"

    Silly boy (me!): use wildcards: see correction in following posts.
    Last edited by JohnTopley; 06-21-2016 at 09:15 AM.

  11. #11
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Thumbs up Re: Formula to count text/word in multiple sheets

    @JohnTopley you're a *

    That will be my next big thing as recipes have all different ways of wording of each spice.

    Thank you for your help, much appreciated...


    Also thank you to zbor for helping out

  12. #12
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Re: Formula to count text/word in multiple sheets

    @JohnTopley

    is there a way to change the formula to incorporate multiple sheets with the formula you game me.
    Just that the formula is repetitive for the multiple sheets.
    say if you have 20 different sheets to repeat the same formula (--ISNUMBER(SEARCH(A2,Curry!$A$1:$C$1000)))+SUMPRODUCT for each of the sheets it will be come quiet long! As
    you can see the formula you sent is for 3 sheets only?

    Regards

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,253

    Re: Formula to count text/word in multiple sheets

    Unfortunately SUMPRODUCT does not work over multiple sheets

    Retracting my earlier comment (!!!)..

    Using wildcard with COUNTIF


    =SUMPRODUCT(((COUNTIF(INDIRECT("'" & list&"'!$A1:$C1000"),"*"&A2&"*"))))

    Where List is a named range of all your sheets ("Curry","Chilli", ......)
    Last edited by JohnTopley; 06-21-2016 at 09:17 AM.

  14. #14
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Question Re: Formula to count text/word in multiple sheets



    its giving me a #name error now, *crying in palm of hand*

    is it "'" & "Curry","Chilli","...... with/out ( ) or ""'&

    Starting to think this will be much easier in MS Access

  15. #15
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Re: Formula to count text/word in multiple sheets

    Could i use : in the formula rather

    eg - Curry:Chilli if so how would i incorporate it, i get confused with all the "'*(


  16. #16
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,253

    Re: Formula to count text/word in multiple sheets

    See the attached:

    Named range "List2 is highlighted in Yellow

    formula in Column D
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Re: Formula to count text/word in multiple sheets

    Hi

    @JohnTopley thank you for the feedback, much appreciated. Man you guys have patience of steel

    I have another question not sure if i need to make a new thread or if i can do it in this thread?

    Regards

  18. #18
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,253

    Re: Formula to count text/word in multiple sheets

    If it is related to this topic i.e. Formula to count text/word in multiple sheets add it here.

    If it is completely different, start a new thread.

  19. #19
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Post Re: Formula to count text/word in multiple sheets

    Still same topic

    I have a formula to calculate:

    Say you have 1/2 tsp sugar right = the formula gives you 0.5 but what i'm not to sure is how to add in the name of item.

    eg. 0.5 Sugar and not just the total 0.5

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See Blends & Mixes tab C2 - C9 with formula.

    Regards
    Attached Files Attached Files

  20. #20
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,253

    Re: Formula to count text/word in multiple sheets

    Don't you require "0.5 CUP sugar" ?? (or "teaspoon")?

    if so ...

    =IF(TYPE(SEARCH("/",A2)=1, IF(SEARCH("/",A2=2, VALUE("0 "&LEFT(A3,SEARCH("/",A2+1)),VALUE(LEFT(A2SEARCH("/",A2+1))),VALUE(LEFT(A2SEARCH(" ",A2))) &MID(A2,IND(" ",A2,255)

    Curious to know why you are using decimal units than fractions!!!

  21. #21
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,253

    Re: Formula to count text/word in multiple sheets

    If you are going "Decimal" why not use "Find/Replace" to change "1/2" to "0.5" in all entries?

  22. #22
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Re: Formula to count text/word in multiple sheets

    giving me an error for the above formula.

    "you've entered too many arguments for this function."

    To answer your question, it's just that at the end i'd like to know a overall quantity of the item - not worried about how many cups, tsp or tbls etc.

    Basically i want too see on the data tab the item and quantity thorough out records and all the sheets.
    I'm sure there is a much easier way to go about this, as you've noticed i like complex (why, who knows :P)

    your suggestions are welcome that's how we learn new things.

  23. #23
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,253

    Re: Formula to count text/word in multiple sheets

    Try

    =IF(TYPE(SEARCH("/",A2))=1,IF(SEARCH("/",A2)=2,VALUE("0 "&LEFT(A2,SEARCH("/",A2)+1)),VALUE(LEFT(A2,SEARCH("/",A2)+1))),VALUE(LEFT(A2,SEARCH(" ",A2))))&SUBSTITUTE(SUBSTITUTE(MID(A2,FIND(" ",A2),255),"cup",""),"teaspoon","")

    Or with the units

    =IF(TYPE(SEARCH("/",A9))=1, IF(SEARCH("/",A9)=2, VALUE("0 "&LEFT(A9,SEARCH("/",A9)+1)),VALUE(LEFT(A9,SEARCH("/",A9)+1))),VALUE(LEFT(A9,SEARCH(" ",A9)))) & MID(A9,FIND(" ",A9),255)

  24. #24
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Re: Formula to count text/word in multiple sheets

    Yeah both work, thanks but it includes the other text as well

    eg: 1 teaspoon Himalayan or sea salt(optional but helps absorption of soup) / 1 Himalayan or sea salt(optional but helps absorption of soup)

    instead of

    1 teaspoon Himalayan or sea salt / 1 Himalayan or sea salt

    but i can play around with that number of characters.



    one last ?

    why is this
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    returning 0 result?

  25. #25
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,253

    Re: Formula to count text/word in multiple sheets

    You are going to have real problems here extracting the required data as the text is far from consistent.

    re SUM: A2 is text not numeric. If you want to SUM the data you will need to extract the numbers.

    A better format format for your data would be:

    Columns A to C

    Description e.g Garlic Powder
    Unit: cup, teaspoon
    Quantity: 1/2 (0.5)

    You will spend a lot of effort "unravelling" data. A general (and good) rule of design is one column per attribute.

  26. #26
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Re: Formula to count text/word in multiple sheets

    Cool beans, makes sense.

    I would like to thank you for your help, and patience.

    Keep up the good work....

    Take Care

  27. #27
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,253

    Re: Formula to count text/word in multiple sheets

    If you interested the following will split the text into 3 column (only tested on one sheet)

    Quantity
    Unit
    Description

    =TRIM(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($A1," ","|",1)," ","|",1),"|",REPT(" ",255)),(COLUMNS($A:A)-1)*255+1,255))

  28. #28
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Re: Formula to count text/word in multiple sheets

    Hahahahah same thing i was just trying to put together after your previous post about breaking it up per column.

    Thanks will try this out and let you know.

    Appreciated

  29. #29
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Re: Formula to count text/word in multiple sheets

    Somehow it's only returning the 1st word/num and not three columns unless i'm inputting it wrong!!!

  30. #30
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,253

    Re: Formula to count text/word in multiple sheets

    Sorry ... should have explained: you need to drag across the columns and you will get entries in each column.

    See attached in "Blends & Mixes" : columns D to F
    Attached Files Attached Files

  31. #31
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Re: Formula to count text/word in multiple sheets

    Hi,

    No problem, thanks for the feedback.

    Yeah that's also a way of doing it, cool beans

    Take it easy and much appreciation.

    Regards

+ 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. Multiple sheets - Count all Occurances of the word "Early" if between two dates
    By lookingforhelp1 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-13-2015, 03:00 PM
  2. Replies: 13
    Last Post: 10-06-2014, 09:55 AM
  3. [SOLVED] Count Text across multiple sheets
    By normilet in forum Excel General
    Replies: 2
    Last Post: 07-22-2014, 11:00 AM
  4. [SOLVED] Count instances of a word with column across multiple sheets
    By JohnDeere in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-13-2013, 12:06 PM
  5. Formula for Value by Date & Find Number Count with Word on Multiple Sheets
    By mydragonstalents in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-20-2013, 06:29 PM
  6. Count Specific Text Values in a Word Table Formula
    By cpg3 in forum Word Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2012, 09:37 PM
  7. Replies: 2
    Last Post: 12-09-2009, 06:36 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