+ Reply to Thread
Results 1 to 3 of 3

When dragging a formula horizontally, how to change row instead of column?

  1. #1
    Registered User
    Join Date
    03-03-2013
    Location
    Rio, Brazil
    MS-Off Ver
    Excel 2010
    Posts
    3

    When dragging a formula horizontally, how to change row instead of column?

    For an example, suppose I have 10 columns and 10 rows, and in whitch, a number.
    I want to compare each row with all the others, looking for how many cells in the same row have the same value.

    To compare rows, in this example, I used =SUMPRODUCT(--(A1:J1=A2:J2)) in row 1.
    dragging the formula down, I will compare each row with the row below.

    Now, I want to compare row 1 with rows 3,4...10 in line 1. I would have to lock A$1:J$1 in the formula, an then drag to te right, and there's my issue.
    How do i change the row instead of the column when dragging the formula horizontally? Another issue, to make things work, to drag down the whole row of formulas, I would have to unlock the A$!:J$1. But it is locked in the 9 cells I compare the first row values with.

    I did it by hand in the attached example, but would be unthinkable to do so in my original file with 870 rows.

    Any Ideas? Is there a way to lock/unlock a bunch of formulas in different cells at the same time?

    I attached an example file of what i want to do. Any Ideas?
    Thanks in advance!test comparison.xlsx

  2. #2
    Registered User
    Join Date
    03-03-2013
    Location
    Rio, Brazil
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: When dragging a formula horizontally, how to change row instead of column?

    made a workaround... kinda worked.

    fixed the values A$1:J$1 on the first cell's formula
    dragged all the way down
    copied
    paste transpose
    search/replace A$1:J$1 for A1:J1 with the whole first row selected.
    then just dragged the row down. Voilá!

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: When dragging a formula horizontally, how to change row instead of column?

    hi Aderbalito, welcome to the forum. glad you found a way. if you're satisfied with the answer, please mark it as "Solved". my signature in the thread will guide you how to do that. thanks
    =)

    an alternative is to put this in M1:
    =SUMPRODUCT(--($A1:$J1=OFFSET($A3,COLUMNS($M1:M1)-1,,,10)))

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

+ 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