+ Reply to Thread
Results 1 to 17 of 17

Copying these formulas to adjacent cells across the worksheet.

  1. #1
    Forum Contributor
    Join Date
    03-28-2012
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2010
    Posts
    166

    Copying these formulas to adjacent cells across the worksheet.

    =SUMPRODUCT(--(LinenData!D$2:D$2500=Totals!N$1)*(LinenData!C$2:C$2500=Totals!$A3),LinenData!G$2:G$2500) Cell A1
    =SUMPRODUCT((LinenData!D$2:D$2030=Totals!N$1)*(LinenData!C$2:C$2030=Totals!$A3),LinenData!H$2:H$2030) Cell B1

    Is here is my dilemma! The two formulas are in their respective cells listed above. I need to change the formula in B1 to reflect =SUMPRODUCT((LinenData!D$2:D$2500=Totals!N$1)*(LinenData!C$2:C$2500=Totals!$A3),LinenData!H$2:H$2500) the cell address then I need to copy it down to the next 25 rows which I can do, problem rest when I try to copy the formulas across the worksheet because it changes the data. Is there a way to copy these formulas faster than to have to manually go in and change them.

    So then C1 would have =SUMPRODUCT(--(LinenData!D$2:D$2500=Totals!P$1)*(LinenData!C$2:C$2500=Totals!$A$3),LinenData!G$2:G$2500) and D1 would have =SUMPRODUCT((LinenData!D$2:D$2500=Totals!P$1)*(LinenData!C$2:C$2500=Totals!$A3),LinenData!H$2:H$2500) then all the way across the worksheet it would continue to increment the cell location in the formula by every other cell (Totals!P$1)

    Hope this makes sense??

    LeapingLizard

  2. #2
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: Copying these formulas to adjacent cells across the worksheet.

    Hi LeapingLizard,

    First of all you do not need the double-negation in your formula, removing that will make your formula more consistent.

    It's hard to imagine the pattern of your formula by just looking at the 4 formulas above, could you manually fill the formulas for cells below so that members could have a better view of the scenario?
    A1=
    B1=
    C1=
    D1=
    E1=
    F1=

    A2=
    B2=
    C2=
    D2=
    E2=
    F2=


    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  3. #3
    Forum Contributor
    Join Date
    03-28-2012
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2010
    Posts
    166

    Re: Copying these formulas to adjacent cells across the worksheet.

    Yes Alvin-Chung,

    Here is how it would look. This information will be couple over around 40-60 columns then down about the same amount of rows.


    A1=SUMPRODUCT((LinenData!D$2:D$2500=Totals!D$1)*(LinenData!C$2:C$2500=Totals!$A3),LinenData!G$2:G$2500)
    B1=SUMPRODUCT((LinenData!D$2:D$2500=Totals!D$1)*(LinenData!C$2:C$2500=Totals!$A3),LinenData!H$2:H$2500)
    C1=SUMPRODUCT(--(LinenData!D$2:D$2500=Totals!F$1)*(LinenData!C$2:C$2500=Totals!$A3),LinenData!G$2:G$2500)
    D1=SUMPRODUCT((LinenData!D$2:D$2500=Totals!F$1)*(LinenData!C$2:C$2500=Totals!$A3),LinenData!H$2:H$2500)
    E1=SUMPRODUCT(--(LinenData!D$2:D$2500=Totals!H$1)*(LinenData!C$2:C$2500=Totals!$A3),LinenData!G$2:G$2500)
    F1=SUMPRODUCT((LinenData!D$2:D$2500=Totals!H$1)*(LinenData!C$2:C$2500=Totals!$A3),LinenData!H$2:H$2500)

    A2=SUMPRODUCT(--(LinenData!D$2:D$2500=Totals!D$1)*(LinenData!C$2:C$2500=Totals!$A4),LinenData!G$2:G$2500)
    B2=SUMPRODUCT((LinenData!D$2:D$2500=Totals!D$1)*(LinenData!C$2:C$2500=Totals!$A4),LinenData!H$2:H$2500)
    C2=SUMPRODUCT(--(LinenData!D$2:D$2500=Totals!F$1)*(LinenData!C$2:C$2500=Totals!$A4),LinenData!G$2:G$2500)
    D2=SUMPRODUCT((LinenData!D$2:D$2500=Totals!F$1)*(LinenData!C$2:C$2500=Totals!$A4),LinenData!H$2:H$2500)
    E2=SUMPRODUCT(--(LinenData!D$2:D$2500=Totals!H$1)*(LinenData!C$2:C$2500=Totals!$A4),LinenData!G$2:G$2500)
    F2=SUMPRODUCT((LinenData!D$2:D$2500=Totals!H$1)*(LinenData!C$2:C$2500=Totals!$A4),LinenData!H$2:H$2500)


    Hope this helps! Thanks

    LeapingLizard

  4. #4
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: Copying these formulas to adjacent cells across the worksheet.

    Hi LeapingLizard, is this what you're looking for?
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Then copy across rest of the cells.


    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  5. #5
    Forum Contributor
    Join Date
    03-28-2012
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2010
    Posts
    166

    Re: Copying these formulas to adjacent cells across the worksheet.

    Hello,


    I tried this and it did not work. Sorry! Any other suggestions. It changed the value that is currently in that cell to 0.

    LeapingLizard

  6. #6
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: Copying these formulas to adjacent cells across the worksheet.

    Hi LeapingLizard, could you evaluate the formula and share which section that goes wrong?


    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Copying these formulas to adjacent cells across the worksheet.

    i can see you are missing a bit
    INDIRECT(ADDRESS(1,2+ROUNDUP(COLUMN()/2,0)*2,,,"Totals"))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  8. #8
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: Copying these formulas to adjacent cells across the worksheet.

    Quote Originally Posted by martindwilson View Post
    i can see you are missing a bit
    INDIRECT(ADDRESS(1,2+ROUNDUP(COLUMN()/2,0)*2,,,"Totals"))
    Oh dear, how could I missed that out
    Thanks Martin.

    Hi LeapingLizard, could you try again if this is working in your actual work?
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  9. #9
    Forum Contributor
    Join Date
    03-28-2012
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2010
    Posts
    166

    Re: Copying these formulas to adjacent cells across the worksheet.

    Hi again,


    I have copied what you sent me into A1 and it through a #value error. Does it matter how it is formatted?

    Thanks,

    Dan

  10. #10
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: Copying these formulas to adjacent cells across the worksheet.

    Hi Dan,

    What is the result you get for below?
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  11. #11
    Forum Contributor
    Join Date
    03-28-2012
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2010
    Posts
    166

    Re: Copying these formulas to adjacent cells across the worksheet.

    Hi Alvin,

    It is number that is pulled from comparing cell contents within each worksheet. I have it formatted as general currently. Would it help to declare the type of number whether currency or numeric? The number that is pulled is displayed as 90.31. I don't know if this will help. I am just looking for a way to copy the formula across the cells in the row A1 through DF1 without having to manually edit where to pull the data from LinenData!D$2:D$2500. Currently it shows as LinenData!D$2:D$2030. Because of gathering more data as we get busier I have to extend the input range. Also, for me to copy the formula across the sheet, I can't, because it is not sequential. It is every other column that the information is pulled from. As you see in the example I sent above.

    I hope this all makes sense. Essentially, the formula compares cells when it finds the matches it displays the value associated with it.

    Thanks,

    LeapLizard

  12. #12
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: Copying these formulas to adjacent cells across the worksheet.

    Yea, that's the purpose of the formula proposed

    Could you try change the range of my formula from 2500 to 4 (e.g. $C$2500 become $C$4) for troubleshooting purposes, then use the Evaluate function to step through the details and see where you're getting the error?


    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  13. #13
    Forum Contributor
    Join Date
    03-28-2012
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2010
    Posts
    166

    Re: Copying these formulas to adjacent cells across the worksheet.

    So LinenData is a sheet that has a data base which orders are made everyday. So for instance each day, company A, orders towels at different quantities and the totals sheet calculates how many towels throughout the month did Company A order. So the Company or Department when the order the formula finds all Towel orders in cells(c$2:c$2500) for company A in cells(d$2:d$2500) and totals up number of towels ordered for company A was 1500 and stores it in the totals sheet.
    The totals sheet has a column for every company that orders and all the products they order and as the orders increase the totals page keeps that running total.

    With that said, everyday the totals sheet will have an incremented number of towels that they've purchased. So day 1 (5), day 2 (25), day 3 (10) and day 4 (30) total towels for company A is stored in totals sheet in d$3 (70). Then company b total number of towels for the month is stored in F$3 and so on. In order to adjust the row to D$2500 from d$2030 because of increased data entries I would have to physically go in and change every formula.

    I hope this makes sense. If not maybe I will attach a shorten version for your viewing.

    Let me know,

    Thanks

    LeapingLizards

  14. #14
    Forum Contributor
    Join Date
    03-28-2012
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2010
    Posts
    166

    Re: Copying these formulas to adjacent cells across the worksheet.

    Hi Alvin,

    Just wondering if you had read my reply.

    Thanks,

    LeapingLizard

  15. #15
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Copying these formulas to adjacent cells across the worksheet.

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  16. #16
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: Copying these formulas to adjacent cells across the worksheet.

    Hi LeapingLizard,

    Just read your message, I believe we've come to a stage where sample file with your working formula (shorter range) is required.


    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  17. #17
    Forum Contributor
    Join Date
    03-28-2012
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2010
    Posts
    166

    Re: Copying these formulas to adjacent cells across the worksheet.

    Okay! So with the totals sheet, the formula that is in D3 and E3 colored in red need copied all the way across the sheet in the same row to update and to reflect D2:D2500 in the formula. It will copy down just fine. The way it is set up it will not copy all the way across correctly to reflect the formulas in D3 and E3.
    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] Copying adjacent cell over from different worksheet
    By dlamberth in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-14-2013, 03:44 PM
  2. Copying cells according to adjacent column
    By MDLDK in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 07-08-2010, 02:52 AM
  3. Copying adjacent cells in a particular order
    By rohit330 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-21-2010, 10:19 AM
  4. Copying non-adjacent cells
    By gtoman in forum Excel General
    Replies: 2
    Last Post: 11-18-2008, 07:51 PM
  5. copying adjacent cells with formula
    By tanner in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-15-2006, 09:55 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