+ Reply to Thread
Results 1 to 4 of 4

XLOOKUP - copying formula horizontally - while skipping certain columns

  1. #1
    Registered User
    Join Date
    09-19-2023
    Location
    BC, Canada
    MS-Off Ver
    365
    Posts
    3

    Exclamation XLOOKUP - copying formula horizontally - while skipping certain columns

    Hi!

    I've run into a problem. I want to save time but i can't seem to figure out a solution yet.

    I have a document with multiple sheets

    On SHEET2, in B3, my formula that works great is =SUM(XLOOKUP(A3, SHEET1!A4:A103,SHEET1!B4:B103))

    but i want to copy it across horizontally without having to change any information (i have columns going to BQZ on SHEET1)

    so on SHEET2 C3 I want the formula to say =SUM(XLOOKUP(A3, SHEET1!H4:H103,SHEET1!I4:I103))
    so moving over 7 spaces each time

    is there a way that i can do this so i dont have to manually adjust this formula 365 times!

    Thank you ahead of time if you are able to help
    Last edited by samfor; 09-20-2023 at 11:13 AM. Reason: SOLVED

  2. #2
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,433

    Re: XLOOKUP - copying formula horizontally - while skipping certain columns

    Please try on Sheet2 in B3 and copy to the right:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The SUM function adds nothing to the formula, because XLOOKUP ($A4,...) always returns only 1 value (or error).

    In addition, there is a good chance that what you want to achieve is also possible with a more efficient SUM or SUMPRODUCT without XLOOKUP and INDEX.
    This depends on what is in the column headings (and what exactly you want).
    Attached Files Attached Files
    Last edited by HansDouwe; 09-19-2023 at 10:04 PM.

  3. #3
    Registered User
    Join Date
    09-19-2023
    Location
    BC, Canada
    MS-Off Ver
    365
    Posts
    3

    Re: XLOOKUP - copying formula horizontally - while skipping certain columns

    Thank you for your reply! I've attached a file to better explain what i need to complete, I also got rid of the Xlookup and used SUMPRODUCT

    =SUMPRODUCT(--ISNUMBER(FIND($A3,Sheet1!A4:A17))*Sheet1!B4:B17)

    Sheet1 column A could have the same product more than once, so i want the total for that each day
    column B is the amount of the product

    I can easily change it to

    =SUMPRODUCT(--ISNUMBER(FIND(A4,Sheet1!$A$4:$A$17))*Sheet1!$B$4:$B$17)

    to drag vertically and have the formula stay correct

    but i want to be able to drag it horizontally so i can avoid changing the columns for the next 363+columns in my document

    I hope this makes sense!

    Thank you again!
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    09-19-2023
    Location
    BC, Canada
    MS-Off Ver
    365
    Posts
    3

    Re: XLOOKUP - copying formula horizontally - while skipping certain columns

    I think I just figured it out using your previous help!

    =SUMPRODUCT(--ISNUMBER(FIND($A3,INDEX(Sheet1!4:17,,7*COLUMN(A1)-6)))*(INDEX(Sheet1!4:17,,7*COLUMN(A1)-5)))

+ 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. Fixing an XLOOKUP reference to drag/flash fill horizontally
    By redfox2000 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-20-2022, 01:27 PM
  2. [SOLVED] Drag Formula Horizontally With Vertical Reference (With Skipping Columns)
    By Saradomin in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-12-2022, 06:53 AM
  3. Skipping rows when copying formula down
    By Briilee in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-26-2018, 10:47 AM
  4. copying formula and skipping rows.
    By rulermon in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-30-2017, 06:02 PM
  5. [SOLVED] Copying a formula down but skipping cells
    By dnsmc in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-15-2013, 03:05 AM
  6. Replies: 4
    Last Post: 01-19-2012, 07:45 AM
  7. Skipping columns when copying formula
    By rhudgins in forum Excel General
    Replies: 13
    Last Post: 09-07-2011, 03:15 PM

Tags for this Thread

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