+ Reply to Thread
Results 1 to 6 of 6

Formula doesn't work when given range instead of column

  1. #1
    Registered User
    Join Date
    08-02-2021
    Location
    Vilnius
    MS-Off Ver
    Professional Plus 2016
    Posts
    2

    Formula doesn't work when given range instead of column

    Hi everyone!

    I try to make my formula working. I have various suppliers in column 1, usually they have blank cells in between them. I need to create formula for column 2 which would return first instance of supplier name starting from the same row where the formula is upwards. I have formula which returns the last suppliers name, I want to start with that but as soon as I replace column A:A with a specific range, like A3:A36, it stops working.



    Screenshot 3.png Screenshot 4.png Desirable result.png
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,192

    Re: Formula doesn't work when given range instead of column

    Please see the yellow banner on how to attach a workbook. Images are of little (or no) value.

  3. #3
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Formula doesn't work when given range instead of column

    I have formula which returns the last suppliers name, I want to start with that but as soon as I replace column A:A with a specific range, like A3:A36, it stops working.
    so, the reason the 2nd doesn't work is that your INDEX range doesn't align to the ROW being returned by the SUMPRODUCT -- e.g

    =INDEX(A:A,10) -> A10
    =INDEX(A3:A36,10) -> A12 {the 10th element in the defined range}

    so, given you're returning a ROW number in the SUMPRODUCT your INDEX should remain A:A, i.e.

    =INDEX(A:A,SUMPRODUCT(MAX((A3:A36<>"")*ROW(A3:A36)))

    that said, if your blanks are true blanks (and not null strings) you might find you can revert to the below, which would be much more efficient :

    =LOOKUP(REPT("Z",255),A3:A36)

    or, if per second screenshot you're looking to 'fill down' in Column B you can just use something like:

    B3: =IF(A3<>"",A3,B2)
    copied down
    Last edited by XLent; 08-03-2021 at 04:59 AM.

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Formula doesn't work when given range instead of column

    Hello dzumis. Welcome to the forum.

    Somewhat similar to XLent's approach:
    Given the screenshot setup and no clues how to identify the range limits in column A I propose 2 things.
    1) a helper cell that specifies the upper limit of the range ... say B1
    2) this "dynamic" named range in Name Manager Suppliers =Sheet1!$A$3:INDEX(Sheet1!$A:$A,Sheet1!$B$1)

    Then use this formula in B3 and fill down until you get blanks.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    That will fill your output beyond the last Supplier1 as shown in screenshot.

    Change the upper limit in B1 as needed. Until there is a way to automatically identify that upper limit by the data there remains the need for this manual input.
    Last edited by FlameRetired; 08-03-2021 at 03:16 PM.
    Dave

  5. #5
    Registered User
    Join Date
    08-02-2021
    Location
    Vilnius
    MS-Off Ver
    Professional Plus 2016
    Posts
    2

    Re: Formula doesn't work when given range instead of column

    XLent, wonderful!

    Thank you a lot, you really saved me a lot of time!

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Formula doesn't work when given range instead of column

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. Range.FormulaArray - R1C1 formula in A1-style worksheet doesn't work??
    By Merf in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-19-2020, 08:33 AM
  2. Why the formula to get Dynamic named range doesn't work?
    By qzqzjcjp in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-02-2019, 12:47 AM
  3. Replies: 9
    Last Post: 11-19-2014, 04:15 PM
  4. Formula range auto extend doesn't work in office 2007
    By crunchor in forum Excel General
    Replies: 3
    Last Post: 08-03-2014, 09:56 PM
  5. [SOLVED] Applying formula to entire column doesn't always seem to work
    By Drayde in forum Excel General
    Replies: 3
    Last Post: 03-13-2014, 10:46 AM
  6. Replies: 2
    Last Post: 03-03-2014, 10:56 AM
  7. If statement doesn't work for range?
    By deeppurple247 in forum Excel General
    Replies: 4
    Last Post: 02-07-2007, 07:55 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