+ Reply to Thread
Results 1 to 7 of 7

IF/OFFSET Problem

  1. #1
    Forum Contributor
    Join Date
    04-11-2008
    Posts
    156

    IF/OFFSET Problem

    Hi,

    I have a problem with the following IF/OFFSET formula which is dragged down the length of a worksheet:

    =IF(ISERROR(IF(A,DataLink!D1550)),"",IF(A,DataLink!D1550))
    Where A =OFFSET(DataLink!$A$1,0,0,COUNTA(DataLink!$A:$A),1)

    The DataLink worksheet is fed from a database and exists in the same spreadsheet as the worksheet which contains the above formula. When the spreadsheet is opened, DataLink is refreshed, invariably with new rows of data.

    The problem I am facing is that when DataLink is refreshed, the IF formula in the first new row of data changes its row reference to the last new row of data and each subsequent row reference follows in numerical order – the result being that blank fields are referenced and no data is being pulled through.

    Any ideas? Your help would be gratefully appreciated.

    Thank you

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: IF/OFFSET Problem

    Hi,

    Somewhat difficult to comment without seeing an example and knowing in which row that formula is recorded, however try putting it in row 1 and changing the reference to 1550 to 1. Then drag it down.

    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    04-11-2008
    Posts
    156

    Re: IF/OFFSET Problem

    Hi Richard,

    Thank you for your reply. I'm not entirely sure what you are advising?

    In response to your question though, DataLink is refreshed from a database on opening. If a new record of data has been entered in the database, this record is entered in Datalink as a new row of data and is entered at the bottom of the existing list. So the number of rows of data in DataLink increases everytime a new record is entered in the source database.

    Sheet2 with the IF/OFFSET formula is dragged from row1 to row60,000 and includes the dynamic OFFSET reference to account for the variable number of rows in DataLink.

    If DataLink is refreshed with 20 new rows from rows' 500:520 then the IF formula in Sheet2/row 500 which was referenced to DataLink/row 500 will unintentionally change its row reference to Datalink/row 520 which is the last row of new data. Each subsequent row will then follow suit i.e from 501 to 521, from 502 to 522 and so on which, given the last new row of data in DataLink is row 520, pulls through blanks.

    I hope this helps clarify my problem.

    Thank you.

  4. #4
    Forum Contributor
    Join Date
    04-11-2008
    Posts
    156

    Re: IF/OFFSET Problem

    Hi,

    Any ideas? I can't really upload an example as the problem is caused when the spreadsheet is refreshed by the data sourc - an external database.

    Any suggestions would be greatly appreciated.

    Thank you

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: IF/OFFSET Problem

    So it sounds as though your refresh is physically inserting rows into DataLink sheet, correct ?

    Try reverting to INDEX, below would be for cell referencing DataLink!D1:

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: IF/OFFSET Problem

    Maybe a stupid question but what is (should be) this formula doing:
    Please Login or Register  to view this content.
    What is in D1550. Seems a bit strange with 'A' being a named range.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  7. #7
    Forum Contributor
    Join Date
    04-11-2008
    Posts
    156

    Re: IF/OFFSET Problem

    DonkeyOte's solution works perfectly.

    Thank you

+ 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