+ Reply to Thread
Results 1 to 10 of 10

how to copy the formula

Hybrid View

  1. #1
    Registered User
    Join Date
    06-07-2012
    Location
    Mangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    17

    Question how to copy the formula

    Hi, I have a QC report which has 30 sheets(for each days report) and a final report sheet (combines the numbers in all 30 sheets). All 30 sheets have the same data for each day. In the last sheet I have coombined all numbers for entire month. I have a formula as =('1'!C103) in Column B and column C should show =('2'!C103) and column D should show =('3'!C103).... till =('30'!C103).

    However when I drag the formula from column B. It gets changed in C, D and other cells. it doesnt change the sheet(date like '2'!, '3'!) but just changes the column C103, D103, E103 etc. How will change the day as '2'!, '3'! and keep the cell number constant?

    Thanks
    Jaya

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: how to copy the formula

    Hi
    why not just change the formulas from relative to absolute references, ie $A$1 not A1

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: how to copy the formula

    If you put the sheet names in column A, in this case just the numbers 1, 2, 3, etc... then this becomes simple enough.


    A2 = 1 (the first sheet name, but it could also be Sheet1, or Monday, or whatever the real sheet name is)
    B2: =INDIRECT("'" & $A2 $ "'!C103")
    C2: =INDIRECT("'" & $A2 $ "'!D99") (this is just to show you create the first row of formulas to ref the cells desired)

    When you've finished creating the INDIRECT() formulas in row 2 based off of the sheetname in A2, now copy that row of formulas downward and they will adjust themselves to ref the sheet listed in column A.

  4. #4
    Registered User
    Join Date
    06-07-2012
    Location
    Mangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: how to copy the formula

    Hi,

    Sorry this doesnt work It shows an error

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: how to copy the formula

    Post your workbook so we can see the error, too.

    Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  6. #6
    Registered User
    Join Date
    06-07-2012
    Location
    Mangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: how to copy the formula

    Hi, i have attached the excel sheet for you reference. Please view the last sheet named Daily report. I have manually enterd the formule for one employee (marked in Blue). The one in green need to be filled, and I need to repeat the same for all the employees your help is greatly appriciated
    Attached Files Attached Files

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: how to copy the formula

    1) On the Daily report, I've searched and cannot find your non-working INDIRECT() formulas. I also do not see on that sheet the cells that have the sheet names you would want.

    Post #2 demonstrated the layout. Somewhere on the sheet is the tab name, then that tabname is used in the INDIRECT() to construct the formula.

    BUT... I have to say, why bother? This appears to be a static layout of 31 days for a month's worth of data. Your formulas as laid out currently on the Daily Report are done, they should just work from now on.


    2) You can simplify your formula on the day sheets.

    C45: =COUNTIF(C2:C40, A45)
    D45: =SUMIF(C2:C40, A45, F2:F40)
    E45: =SUMIF(C2:C40, A45,G2:G40)

  8. #8
    Registered User
    Join Date
    06-07-2012
    Location
    Mangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: how to copy the formula

    Hi,

    I was talking about "Daily Report" cell number B25, C25........AF25 (the one in green colour). B25='1!'B46 (where 1 is the sheet name); C25='2!'B46........... etc. which I need to do for all employees. so when I drag the formule from B to AF i want the sheet name (1,2,3,4,5,6,......31) to be change and Refernce cell B46....should remail same. This is applicable to all employees.

    Thanks
    Jaya

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: how to copy the formula

    In column B you would insert the sheet name somewhere so it could be referenced. Even if it's just the number one, it's useful as a reference, too, so that it is evident.

    So, going back to my original post, follow those instructions.

    B3 = 1
    C3 = 2
    etc.....

    B15: =INDIRECT("'" & B$3 & "'!B45")



    There is no substantive difference between this post and my original post.

  10. #10
    Registered User
    Join Date
    10-17-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2000 & 2007
    Posts
    6

    Re: how to copy the formula

    Hi,

    Here is a possible solution:

    1. Row 14 needs to be unmerged and the format changed to General.

    2. In Row 14 above the Blue lines enter the Day no to which the column refers - B14 value 1, C14 value 2 etc. If you don't want to see the numbers make them the same colour as the Fill.

    3. In cell B15 copy and paste this formula into the formula bar for the cell:

    =INDIRECT("'" & B14 &"'!B45") (very close to that indicated by our eminent Moderator!)

    4. Copy the formula as far right as you need.

    5. Copy and modify as required for cells B17, B19, and B20, and then copy these to the right.

    HTH

    Peter Moran

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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