+ Reply to Thread
Results 1 to 10 of 10

Add column which refers to a worksheet

  1. #1
    Registered User
    Join Date
    05-05-2010
    Location
    Maidenhead, England
    MS-Off Ver
    Excel 2007
    Posts
    39

    Add column which refers to a worksheet

    Hi all,

    I wonder if you can assist me please? I am using excel 2007.

    I have set up a workbook which executes a stored procedure on a sql database, which returns the results to a table.

    I have a control sheet which allows me to input dates, which pass through to the stored proc. From these dates, it works out the networkdays, and multiplies it by 7.5 to give me the standard working hours. It looks like this:

    hoji.png

    I then have a pivot table on a different sheet which looks at my data table to give me the total number of logged hours. I need to compare the logged hours to the working hours to give me a percentage. Like this - but inside the actual pivot table so it is dynamic.

    sxes.png

    Is this possible?

    Thanks
    Paul

  2. #2
    Registered User
    Join Date
    05-05-2010
    Location
    Maidenhead, England
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Add column which refers to a worksheet

    I've sort of got round it by using the formula

    =IF(A2="Grand Total","Ermmm",IF(A2="","",'Control sheet'!$G$3))

    but I'm not sure how I could calculate the Grand Total formula, as this needs to sum everything above its current position (not including the header row).

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,825

    Re: Add column which refers to a worksheet

    Try this:

    =IF(A2="Grand Total",B2/C2,IF(A2="","",'Control sheet'!$G$3))

    though I'm not sure where the formula is on your pictures.

    Hope this helps.

    Pete

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,825

    Re: Add column which refers to a worksheet

    If the formula is in C2, then you can use this:

    =IF(A2="Grand Total",SUM(B$1:B1),IF(A2="","",'Control sheet'!$G$3))

    I think that's what you need, then you would have a percentage formula in column D.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    05-05-2010
    Location
    Maidenhead, England
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Add column which refers to a worksheet

    Hi Pete,

    Thanks, tried your second (C2) formula, but it's not quite what I was after, as this will grand total column B rather than everything in column C above the position of the current cell.

    So with your formula, it shows the grand total in column c as 710.77, but it should show 780 as in my first picture.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Add column which refers to a worksheet

    Paul

    Can you upload an example workbook?
    If posting code please use code tags, see here.

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,825

    Re: Add column which refers to a worksheet

    Quote Originally Posted by A[L]C View Post
    ... it's not quite what I was after, as this will grand total column B rather than everything in column C above the position of the current cell...
    Sorry, it should have been this in C2:

    =IF(A2="Grand Total",SUM(C$1:C1),IF(A2="","",'Control sheet'!$G$3))

    Note the changes in the SUM function.

    Hope this helps.

    Pete

  8. #8
    Registered User
    Join Date
    05-05-2010
    Location
    Maidenhead, England
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Add column which refers to a worksheet

    perfect, thank you pete

  9. #9
    Registered User
    Join Date
    05-05-2010
    Location
    Maidenhead, England
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Add column which refers to a worksheet

    Just a shame I can't get it to change the cell format of the bottom row to match the Grand Total of the pivot table

  10. #10
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,825

    Re: Add column which refers to a worksheet

    You can use conditional formatting to do that.

    Pete

+ 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. Forumla which refers to a cell which refers to a sheet name
    By awiller2 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 12-03-2012, 09:57 PM
  2. How do I find out what row 'rng' refers to?
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-09-2011, 05:06 PM
  3. [SOLVED] Access a worksheet level named range with Refers To like "=5".
    By Jeremy Gollehon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2006, 06:10 PM
  4. Same Name refers to local ranges
    By Mats Samson in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  5. toggling which worksheet a named range refers to
    By Loftus in forum Excel General
    Replies: 0
    Last Post: 03-29-2005, 08:06 PM

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