+ Reply to Thread
Results 1 to 8 of 8

IF #ref! error

Hybrid View

  1. #1
    Registered User
    Join Date
    09-16-2008
    Location
    UK
    Posts
    11

    IF #ref! error

    I am trying to automatically create a clinic list using a Waiting and Review list. I have created an IF formula that checks the review list first to see if there are any review dates within the next two weeks. If there isn't then the first name from the waiting list is added to the clinic. This is my very amateur-ish formula:

    =IF('REVIEW 09'!F5>=TODAY(),IF('REVIEW 09'!F5<=TODAY()+14,'REVIEW 09'!A5,WAITING!A4))

    My problem, for example, is when I delete the row F5 because it no longer needs to be on the review list, it shows as a #ref! error on the clinic. Is there any way around this? The rest of the review sheet shifts up so that the information underneath is now in F5 and I don't understand why it doesn't use the new information.

    I'm not very good at explaining myself so please ask if I've missed something out.

    Thanks in advance for any help!

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: IF #ref! error

    There are ways around it, but seeing an example workbook would help explain it.
    Entia non sunt multiplicanda sine necessitate

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

    Re: IF #ref! error

    The cell you're referencing no longer exists hence the #REF

    Traditional solutions:

    =IF(AND(INDEX('REVIEW 09'!F:F,5,1)>=TODAY(),INDEX('REVIEW 09'!F:F,5,1)<=TODAY()+14),INDEX('REVIEW 09'!A:A,5,1),WAITING!A4)
    Or INDIRECT

    =IF(AND(INDIRECT("'REVIEW 09'!F5")>=TODAY(),INDIRECT("'REVIEW 09'!F5")<=TODAY()+14),INDIRECT("'REVIEW 09'!A5"),WAITING!A4)
    I prefer the former approach myself.

  4. #4
    Registered User
    Join Date
    09-16-2008
    Location
    UK
    Posts
    11

    Re: IF #ref! error

    Thats great, solved it! Having trouble getting my head around it though. I like to understand things before I use them so I'll spend the next hour going over it!

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: IF #ref! error

    you could reference it with indirect instead
    in this format

    =IF(INDIRECT("sheet1!F5")=10,"true","false")
    now if you say put 20 in F5 and 10 in F6 youd see false
    but if you delete row 5 f5 would now be =10 and youd see true

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: IF #ref! error

    If the formula is a one-off, both those solutions work fine. Neither copies across or down.

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

    Re: IF #ref! error

    shg, I'm not sure who that is directed at (presumably me) but without more info in terms of where and in what context the formula provided is to be used it's hard to offer a dynamic solution.

    IMO, given context, you should go for INDEX over INDIRECT.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: IF #ref! error

    Both you and Martin; and I agree with your comment. Ergo the request for the workbook.

    However, all's well that ends well, so well done.

+ 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