+ Reply to Thread
Results 1 to 24 of 24

Applying the INDIRECT or INDEX function on formula to solve #REF issue

  1. #1
    Registered User
    Join Date
    05-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    12

    Applying the INDIRECT or INDEX function on formula to solve #REF issue

    Hello all from The Netherlands,

    I've finally decided to register after I already used alot of archived posts to help me further, thanks for the great resource this forum provides! . This time, however, I really require some problem specific help. I have a excel workbook where I have one sheet monitoring the other. Both have the same lay-out with in the A column names of employees and then each following column represents a day. In one sheet each column contains the task for that day, the other sheet converts this in 1 (busy), or 0 (nothing to do) so it makes it easy for me to do some more advanced calculations and programming to it. (it also includes other numbers for other states).
    When I delete something I keep getting #REF errors in my formula that converts it to either 1 or 0. I found out that this can be solved by using the INDIRECT or INDEX function. However, I failed to apply this properly to my function so could anybody help me with that?

    Please Login or Register  to view this content.
    Thanks!
    Last edited by Flight777; 05-24-2012 at 09:24 AM.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    Hi and welcome to the forum.

    Would you upload a small sample workbook for us?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    05-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    Sure, here you go:

    Book2.xls

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    What do you delete: entire row, netire column, data in cell...?

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    ...When I delete something I keep getting #REF errors in my formula that converts it ....
    I am not able to see #REf errors, if i delete something..

    Where exactly, is the problem?

  6. #6
    Registered User
    Join Date
    05-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    Data in cells. So tasks and workorders.

  7. #7
    Registered User
    Join Date
    05-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    Quote Originally Posted by Fotis1991 View Post
    I am not able to see #REf errors, if i delete something..

    Where exactly, is the problem?
    Yes that is the weird thing, sometimes it doesn't give #REF errors (in the formula) and sometimes they do appear. Especially when I select a larger area and delete that (the data that is).

  8. #8
    Registered User
    Join Date
    05-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    I found this thread which looks very similar to my problem, I do not delete columns or rows, however:

    http://www.excelforum.com/excel-gene...-a-column.html

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    In Availability Sheet, F16, for example, exist this formula and gives as result 1

    =IF(AND(ISBLANK($A15);ISBLANK(Planning!F16));"";IF(ISBLANK(Planning!F16);0;1))

    If i delete the word in (Planning!F16, gives me 0. Not error...

    This result is Corect, regarding the formula. Isn't it?

  10. #10
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    He delete column in that question. If you delete value in a cell you shoudln't get REF error.

    REF error you get when there is a reference problem.

    For example, write formula: =ROW(C3)-1 and you get result 2.
    But if you put this in ROW 10 and pull formula up you will get reference error when you go below C1 (because there is no row C0)...
    Now, the question is where you lose your reference?

  11. #11
    Registered User
    Join Date
    05-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    No what I mean with #REF error is that the formula returns 1 and reads:

    =IF(AND(ISBLANK($A11);ISBLANK(Planning!#REF!));"";IF(ISBLANK(Planning!#REF!);0;1))

    This returns 1 while the cell in planning is empty and thus it should return 0

  12. #12
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    Just pull your formula over that cell and they should get corrected.
    This can happend if you delete B column or 12th row but not if <ou delete data in B12

  13. #13
    Registered User
    Join Date
    05-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    I still get it and I don't delete any columns or rows. I already corrected in the way you said everytime, but I want to automate the process and then when it happens the system can't correct it and thinks it is a 1 I don't change anything to the planning sheet other that deleting data in cells.

  14. #14
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    you have code that cuts cells so you would get #REF errors in formulas that referred to the cells that were in the location that you pasted the cut cells.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  15. #15
    Registered User
    Join Date
    05-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    Yes it "moves" the tasks back a day when it detects it is on the next day. Can I do something to prevent those errors?

  16. #16
    Forum Contributor Russell Dawson's Avatar
    Join Date
    03-01-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2007
    Posts
    608

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    Forgive the intrusion.

    Am I correct in thinking that you would be deleting columns in Planning! (Col B) when that day is past. Or perhaps all that week. If so you would also be deleting the column B in Availability!. You'd need to change the way the day is calculated in row 6.

    Or am I mistaken?
    If I helped, please don't forget to add to my reputation. (click on the star below the post)

    If the problem is solved, please: Select Thread Tools (on top of your 1st post) -> Mark this thread as Solved.

    Failure is not falling down but refusing to get up.

  17. #17
    Registered User
    Join Date
    05-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    No, the code should run when Excel is started and looks when the planning sheet was last updated. If it sees that it is yesterday, it will select all the data (so from row 9 and on) of the other 14 days (in total there are 15 days), cut the data, and move it to the left with a -4 offset (4 quarters = 1 day). So I don't delete anything. :P

  18. #18
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    you should copy and paste and then clear the old data cells instead of cutting them.

  19. #19
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    And make the cell reference absolute before copy and paste.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  20. #20
    Registered User
    Join Date
    05-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    Quote Originally Posted by JosephP View Post
    you should copy and paste and then clear the old data cells instead of cutting them.
    Ok I will try that

    @vlady, is there a easy/lazy way to do that instead of manually go to each cell? Because I did not make them absolute so that I could use autofill.

  21. #21
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    the cell references shouldn't need to be changed-it's only the fact that you are effectively deleting cells that is causing the error.

  22. #22
    Registered User
    Join Date
    05-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    I will edit the code to reflect your proposed solution and run it during the next test and let you know the outcome. Thanks for all the help, didn't know it would go that quick!

  23. #23
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    Hmm?
    I'm late in joining this thread, but if you put this formula in Sheet"Availability" B10
    Please Login or Register  to view this content.
    Drag Across to Column BI, then down as required.

    Does this help with your #REF errors, or am I on the wrong track?
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  24. #24
    Registered User
    Join Date
    05-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Applying the INDIRECT or INDEX function on formula to solve #REF issue

    The copy pasting seems to work until now, thanks again for all the help!

+ 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