+ Reply to Thread
Results 1 to 8 of 8

Horizontal / vertical - drag formula

  1. #1
    Registered User
    Join Date
    12-13-2018
    Location
    SPAIN
    MS-Off Ver
    7
    Posts
    7

    Horizontal / vertical - drag formula

    Hi everyone,

    Hope you are doing well.

    Do you guys know how to drag the same formula horizontally and then vertically without typing the formula manually first in the first row and then dragging it down?

    Thank you so much for your time

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Horizontal / vertical - drag formula

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? However, please give us an indication of the approximate number of rows of data you want the solution to work with (100, 1000, 100,000 or whatever). Please don't attach a picture of an Excel sheet (no-one will want to re-type all your stuff before starting).

    1. It does NOT have to be your real sheet - mock up a SAMPLE if you need to. But not 1000's of rows!!! It makes manual checking so tedious. Whatever you do... make sure that all confidential information is removed first!!

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

    3. Make sure that your desired solution is also shown (mock up the results manually).

    4. Try to avoid using merged cells. 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.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,728

    Re: Horizontal / vertical - drag formula

    Yes - you need to understand an implement relative referencing: https://edu.gcfglobal.org/en/excel20...-references/1/
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Horizontal / vertical - drag formula

    You need to hardcore the references in the formula and then drag it to the right and down. Example:
    =VLOOKUP(D3,H3:H7,1,0) - this will not work, as the references will change.
    $D3 - This will lock the column reference to only D column
    D$3 - This will lock the row reference to only 3rd row
    $D$3 - This will lock both the column and the row
    Do the same with H3:H7.

    Pressing F4 on keyboard will lock them:
    Once - Both row and column reference
    Twice - The row reference
    Trice - The column reference
    Click the * to say thanks.

  5. #5
    Registered User
    Join Date
    12-13-2018
    Location
    SPAIN
    MS-Off Ver
    7
    Posts
    7

    Re: Horizontal / vertical - drag formula

    Thank you very much for your quick response.

    1) Please give us an indication of the approximate number of rows of data you want the solution to work with = 1000

    I did attach the mock, but to put it in an easier way: The formula for C1 is the same as B2, the formula for D1 is the same as for C2, formula E1=D2 and so forth.

    A B C D E F G H I J K
    1
    2
    3
    4
    5
    6
    7
    8
    9
    Attached Files Attached Files

  6. #6
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Horizontal / vertical - drag formula

    Do you guys know how to drag the same formula horizontally and then vertically without typing the formula manually first in the first row and then dragging it down?
    How is it related with the mock file?
    I did attach the mock, but to put it in an easier way: The formula for C1 is the same as B2, the formula for D1 is the same as for C2, formula E1=D2 and so forth.
    You do not have formulas in the mentioned cells

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,728

    Re: Horizontal / vertical - drag formula

    Paul - I am very glad you posted this. I thought I was losing the plot when I looked at the sample workbook.

    DGRRGD - please attach a sample workbook that matches your query.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Horizontal / vertical - drag formula

    1. Delete row 19.

    2. Use this in E3, copied across to H1:
    =$B4+COLUMNS($A:A)-1

    3. Select cells E3 to H4. Copy.

    4. Select E3 to H18. Paste.

    Done.
    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] Help Changing A Vertical Formula To Horizontal
    By artiststevens in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 05:17 AM
  2. Best formula to look both horizontal and vertical
    By trolle in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-20-2016, 04:06 AM
  3. Formula when drag should use horizontal values.
    By Stephen Lopes in forum Excel General
    Replies: 11
    Last Post: 05-26-2016, 09:07 PM
  4. [SOLVED] Need help formula from horizontal to vertical
    By wiewie002 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-30-2016, 05:50 AM
  5. formula to drag horizontally to equal vertical cells
    By jasonanthony in forum Excel General
    Replies: 6
    Last Post: 05-14-2015, 03:24 AM
  6. Replies: 0
    Last Post: 03-21-2012, 10:18 AM
  7. What formula, horizontal and vertical
    By djfatboyfats in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-28-2008, 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