+ Reply to Thread
Results 1 to 7 of 7

Formula To duplicate row references

  1. #1
    Registered User
    Join Date
    03-09-2018
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2013
    Posts
    35

    Formula To duplicate row references

    I have spreadsheet that I attempting to reference the same line both in a negative and positive reference sequentially. However, the sheet I am looking to do this on is about 100 records long. Please see the attached spreadsheet that shows what I am looking to do but in one formula that I can drag down the cells. The only way I know to do this right now is one by one and changing cell references. Please let me know if the request is unclear.

    Capture.JPG

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Formula To duplicate row references

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    03-09-2018
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2013
    Posts
    35

    Re: Formula To duplicate row references

    Alansidman

    While this looks like an extremely simplified question, this is very similar in nature to what I am doing. I have a two-column pivot table with between twenty and a hundred lines of data that I need put on another spreadsheet in order in which it shows but referencing the same lines twice and it is very time consuming.
    I believe I replicated this to the best of my ability in my attachment. I am attempting to create an accounting template for an upload, hence the reasons for referencing the same data twice.

    Thank you!
    Attached Files Attached Files

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Formula To duplicate row references

    I have used Power Query which should be part of your Excel 2013 version. I loaded your "table" to PQ. Added a column for each of the GL accounts and inserted the values as pluses and minus.
    I then removed the original value column and then unpivoted the data.

    Here is the Mcode for that exercise.
    Please Login or Register  to view this content.
    v A B C
    1 Column1 Attribute Value
    2 Cat 170040 10
    3 Cat 544110 -10
    4 Dog 170040 15
    5 Dog 544110 -15
    6 Cow 170040 12
    7 Cow 544110 -12

    File attached.
    Review PQ
    In the attached file
    Click on any cell in the new table
    On the Data Tab, click on Queries & Connections
    In the right window, double click to open Query
    Review PQ steps
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-09-2018
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2013
    Posts
    35

    Re: Formula To duplicate row references

    Are there any other ways of doing this? Maybe even a macro (not preferred but more favorable than power query). It seems to not be very friendly at all when the document is going to be a reusable file and modified. I need this for three different spreadsheets and when I attempt to modify it at all it is not very forgiving.

  6. #6
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Formula To duplicate row references

    Please try

    E1
    =INDEX(B:B,INT((ROW()+1)/2))*IF(ISODD(ROW()),1,-1)

    F1
    =INDEX(A:A,INT((ROW()+1)/2))

    ** formula may be need to adjust if your position data is changed.

    Regards.

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Formula To duplicate row references

    Please Login or Register  to view this content.

+ 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] Combine Values from Duplicate References
    By hzrdc2 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 12-19-2017, 12:58 PM
  2. Vlookup to only pick up 1 value when duplicate references
    By Diesel70 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-27-2017, 10:23 AM
  3. [SOLVED] Vlookup/Index Match with Duplicate references
    By meadnl89 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-01-2016, 01:12 PM
  4. Returning values for duplicate references
    By AlexnL12 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-21-2015, 01:05 PM
  5. Deleting duplicate references with certain criteria
    By AlexnL12 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-09-2014, 08:56 AM
  6. Dissecting a formula string into references/non-references
    By quekbc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-06-2011, 10:52 AM
  7. Checking cells for duplicate references
    By mpkavanagh in forum Excel General
    Replies: 1
    Last Post: 01-10-2011, 04:35 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