+ Reply to Thread
Results 1 to 9 of 9

how to count specific data from first sheet until last sheet

  1. #1
    Registered User
    Join Date
    08-13-2018
    Location
    Malaysia
    MS-Off Ver
    2016
    Posts
    10

    Unhappy how to count specific data from first sheet until last sheet

    How to count the specific data from the first sheet until last sheet (or unlimited sheets if possible) in a workbook.
    For example I want to calculate the 'BINGO' word in all sheets.

    I've tried using COUNT,SUBTOTAL,INDIRECT and SUMPRODUCT, but it only able to count from 1 sheet only.


  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: how to count specific data from first sheet until last sheet

    Use this:

    =SUMPRODUCT(COUNTIF(INDIRECT("'"&E2:E11&"'! A1:B100"),"Bingo"))

    where A1:B100 is the range of cells you want to search and where E4:E11 is a list of the names of the sheets that you want to search. Adjust the ranges as needed.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: how to count specific data from first sheet until last sheet

    Hello and welcome to the forum.

    Take a look here:

    https://www.extendoffice.com/documen...orksheets.html

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: how to count specific data from first sheet until last sheet

    ... and with a bit of jiggery pokery, you can alse get Excel to list all the sheets. Here it is set up to list all but the master sheet. To get it to work, an old inbuilt Excel macro is used. So enable amcros on opening.

    Named range:
    Sheets
    =TRANSPOSE(GET.WORKBOOK(1))&T(NOW())

    Sheetlist
    =OFFSET(Master!$E$2,,,SUMPRODUCT(--(LEN(Master!$E$2:$E$100)>0)))

    In Master, E2, copied down, an array formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    then the SUMPRODUCT:
    =SUMPRODUCT(COUNTIF(INDIRECT("'"&Sheetlist&"'! A1:B100"),"Bingo"))


    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-13-2018
    Location
    Malaysia
    MS-Off Ver
    2016
    Posts
    10

    Re: how to count specific data from first sheet until last sheet

    I used this code before, but somehow it didnt work very well.

    In my case. I have 2 workbooks.
    I use the code in the first workbook to count all the data from the second workbook ( Let say here named as KT.xlsx)
    But somehow, I only managed to count from sheet 1 only.

    Can you help me fix my code so that I can calculate from all the sheets in workbook 2, instead of 1 sheet only.

    =SUMPRODUCT(SUBTOTAL(3,OFFSET([KT.xlsx]Sheet1!$B$46:$B$47,ROW([KT.xlsx]Sheet1!$B$46:$B$47)-MIN(ROW([KT.xlsx]Sheet1!$B$46:$B$47)),,1)),ISNUMBER(SEARCH("Bingo",[KT.xlsx]Sheet1!$B$46:$B$47))+0)

    Thank you

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: how to count specific data from first sheet until last sheet

    Sigh... so there are TWO workbooks. You should have said that initially.

  7. #7
    Registered User
    Join Date
    08-13-2018
    Location
    Malaysia
    MS-Off Ver
    2016
    Posts
    10

    Re: how to count specific data from first sheet until last sheet

    Yah.. I should.
    Thats the main problem..If you can help me with that, Im so honored

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: how to count specific data from first sheet until last sheet

    I'm not sure if it's possible. Couldn't you do the total on the first workbook and then draw the result across to your second workbook??

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: how to count specific data from first sheet until last sheet

    Well, it can be done, sort-of. I forgot that my source file was an xlsx not an xlsm... That wasted a lot of time...
    Conditions:

    1. The source file MUST be open, too.

    2. You assemble the sheet list manually in the COUNTIF file.

    3. If the two files are not in the same location, then the formula needs to include the FULL file path.
    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)

Similar Threads

  1. [SOLVED] Multiple Sheet Export to PDF, one sheet needs specific range based lastrow of data
    By xlyfe in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-25-2018, 07:39 PM
  2. [SOLVED] Pulling specific data from a specific sheet, loading to a temp sheet, for forwarding.
    By Fawkes_ in forum Excel Programming / VBA / Macros
    Replies: 39
    Last Post: 02-17-2017, 11:10 AM
  3. [SOLVED] VBA code to count offline leads from one sheet to another sheet with specific date
    By xlhelp7 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-04-2016, 11:25 PM
  4. i need to add data from todays count sheet to tomorrows count sheet
    By elm907 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-06-2015, 08:26 PM
  5. [SOLVED] Copy and paste data from sheet 2 to sheet 1 based on specific criteria on sheet 1
    By VBADUD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2012, 04:18 AM
  6. HALP! Count and Insert Rows and Specific Data on Another Sheet.
    By goradiar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-13-2012, 08:00 AM
  7. Macro: Count rows in sheet A, copy count in sheet B, paste offset in sheet A
    By Agent:Orange in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-19-2011, 07:56 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