+ Reply to Thread
Results 1 to 3 of 3

Counting values from multiple tables (ranges) with same fields but differing records

  1. #1
    Registered User
    Join Date
    07-08-2022
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    1

    Counting values from multiple tables (ranges) with same fields but differing records

    Hi folks, I’m after some help with a counting problem I can’t solve. Unsure if this should be a pivot table or not, happy to move the thread if needed.

    Situation:
    1 spreadsheet
    Always 8 tabs (example only has 2) representing each Team
    Each tab has a table (actually a range, not a real excel “table”) which has 8 fields/columns exactly the same (example only has 4 not including totals) but different records/rows (different quantity of rows, and different data in rows)

    I’ve attached a spreadsheet that hopefully represents the above
    Columns in each “Team” tab are the same
    Rows are different, both the number of rows and and the info in each row.

    I want to count the people, in each team, doing each job - but in separate role tables. The result tab in the example hopefully explains this.

    My problem is dealing with the different number of rows - I can’t simply make a table that copies data from each tab because the rows change all the time. If a new one is added, the results table wouldn’t see it until I went and adjusted the table again.

    Can anyone help?
    Attached Files Attached Files

  2. #2
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,422

    Re: Counting values from multiple tables (ranges) with same fields but differing records

    worksheet or Tab name : Result

    Cell B3 formula , Drag down and across

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

  3. #3
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Counting values from multiple tables (ranges) with same fields but differing records

    That doesn't work for me; always uses role 1. How about:

    =IFERROR(SUMIF(INDEX(INDIRECT("'"&B$2&"'!B3:D6"),MATCH($A3,INDIRECT("'"&B$2&"'!A3:A6"),),MATCH(INDEX($A:$A,MAX(IF($A$1:$A3="",ROW($A$1:$A3),0))-1),INDIRECT("'"&B$2&"'!B2:D2"),)),"<>"),"")

    This looks up from the current row, finds the first blank row, and uses the row above that, to get the Role.

    Also note that the ranges B3:D6 and A3:A6 could be changed to B:D and A:A. Although if performance is an issue then you could just set it to something like 100 rows or whatever is comfortably above the data you will have in any sheet.

+ 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. Access query to select records from two tables where fields match
    By sumdumgai in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-12-2022, 11:40 PM
  2. [SOLVED] Calculate order values using records in multiple tables
    By mrbrown2607 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-09-2020, 03:10 AM
  3. Replies: 1
    Last Post: 08-29-2019, 09:11 AM
  4. [SOLVED] Counting values in tables that meets multiple criteria
    By Richard07 in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 02-12-2018, 11:47 AM
  5. [SOLVED] KPI for Multiple Values with differing target values
    By TitansGo in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 12-12-2016, 05:16 PM
  6. Access, trim all values in all fields and multiple tables
    By student1976 in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 03-23-2012, 12:13 AM
  7. Replies: 7
    Last Post: 10-18-2007, 11:03 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