+ Reply to Thread
Results 1 to 2 of 2

Combining information from multiple tables in a Pivot with Calculations

  1. #1
    Registered User
    Join Date
    01-29-2018
    Location
    Spartanburg, SC
    MS-Off Ver
    365
    Posts
    3

    Question Combining information from multiple tables in a Pivot with Calculations

    Definitely need someone's expert advice on how to calculate the percentage of units used.
    I have 2 tables pulling information from Sharepoint.
    One table (AttendeeList) includes the # of units allowed for a full week. (2 units per day)
    The other table (DatabyDay) is the recorded attendance by day. Each entry in this table can be counted as 1 unit.
    Consider that any date with data is an 'active date' or 2 possible units for attendance.

    I need to calculate by week by person the percentage of units used. It's fairly simple if there are 5 full days each week.
    for example: John is alloted 10 units per week. He attends morning and afternoons each day monday thru friday. He uses 100% of his alloted units.
    But...if there are only 4 days that week...he only uses 8 units however...with only 4 days in the week it's only possible to use 8 units. So he still uses 100%.

    Things get complicated when there are a different number of possible units.
    I'm wondering if I need to add an additional calculation somewhere that will count the number of possible units in the week?

    And although the majority are alloted 10 units...not all are. So I need to be able to calculate for those people as well.
    I am attaching some sample data and a start of a pivot table in a workbook. I'm open to suggestions or ideas on how to create an accurate calculation. It doesn't have to be in a pivot table...I just started there.

    Thank you for your time!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,532

    Re: Combining information from multiple tables in a Pivot with Calculations

    Hello therays97 and Welcome to Excel Forum.
    This proposal employs formulas as opposed to a pivot table.
    1. A table of units per week is placed on the Poss. Units per Week sheet
    2. Data validation is used to fill cell A1 with a week and cell B1 with P or A on the Percent of Units sheet
    3. A3:A13 are populated using: =IF(ROWS(A$1:A1)>COUNTA(AttList[AttendeeName]),"",AttendeeList!B2)
    4. B2:F2 are populated using: =MIN(DatabyDay[Date])
    5. B3:F13 are populated using: =IF(OR(B$2="",$A3=""),"",COUNTIFS(DatabyDay[[AttendeeName]:[AttendeeName]],$A3,DatabyDay[[Week]:[Week]],$A$1,DatabyDay[[P_or_A]:[P_or_A]],$B$1,DatabyDay[[Date]:[Date]],B$2))
    6. G3:G13 are populated using: =IF(A3="","",SUM(B3:F3)/MIN(INDEX(Table3[Poss. Units],MATCH(A$1,Table3[Week],0)),INDEX(AttList[NumberOFUnits],MATCH(A3,AttList[AttendeeName],0))))
    Note that looking at the AttendeeList sheet it seems that there is a limit of units per attendee as well as per week so the calculation in G3:G13 uses the MIN of those two.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. Calculations within Pivot Tables
    By Datech in forum Excel General
    Replies: 4
    Last Post: 03-19-2012, 03:05 PM
  2. Replies: 1
    Last Post: 03-14-2012, 03:45 PM
  3. Calculations in Pivot Tables
    By mcooper1975 in forum Excel General
    Replies: 3
    Last Post: 06-09-2011, 04:13 PM
  4. Replies: 2
    Last Post: 08-16-2010, 06:40 PM
  5. [SOLVED] Pivot Tables-Calculations?
    By CrimsonPlague29 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-23-2006, 10:55 AM
  6. [SOLVED] Calculations in pivot tables
    By Kathy P in forum Excel General
    Replies: 0
    Last Post: 04-06-2006, 07:15 PM
  7. Calculations that Refer to Pivot Tables
    By BillM in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-23-2005, 10:29 AM
  8. Replies: 0
    Last Post: 03-03-2005, 04:06 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