+ Reply to Thread
Results 1 to 6 of 6

Avoid #REF! error when deleting columns

  1. #1
    Registered User
    Join Date
    05-15-2023
    Location
    Nebraska
    MS-Off Ver
    365
    Posts
    6

    Avoid #REF! error when deleting columns

    Is it possible to avoid the #REF! error when deleting columns that are located in the columns before the formula? For example, I have a spreadsheet set up for my budget, and as a pay period passes, I delete that pay period's information (columns B:D in attached file); but I want the values in the next columns (E:G) that take its place to repopulate with those cells' values. As it is, after deletion, I have to then manually re-enter the missing references. Granted, it's only about 5-10 fixes, but it's still annoying to do on a weekly basis. I've tried INDIRECT and OFFSET, but I couldn't get them to work since I'm deleting columns that are before the columns in those references. A sample formula in my spreadsheet:

    As I delete columns B:D, which all go together, I want the information currently in the next 3 columns (E:G) to replace those values. Then, I want D6, G6, and J6 to still call the same cells that are currently referenced in those formulas, but with the values that moved over. Is this possible WITHOUT macros? Because macros can't run in the mobile app.

    I hope this makes sense! THANK YOU!
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: Avoid #REF! error when deleting columns

    When you delete D5, it is impossible for Excel to remember what WAS in that cell. If I undertsand you correctly, it cannot be done.

    BUT... just in case, please add the expected results to a sheet 2 in the sample file AFTER deletion of the original columns B-D.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    05-15-2023
    Location
    Nebraska
    MS-Off Ver
    365
    Posts
    6

    Re: Avoid #REF! error when deleting columns

    I don't want it to remember what was previously in columns B:D, I want to move the current values in columns E:G over to B:D when B:D is deleted, just replacing the values.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-03-2023
    Location
    Tucuman, Argentina
    MS-Off Ver
    365
    Posts
    23

    Re: Avoid #REF! error when deleting columns

    As Glenn said, if you keep the formula in G5 and G6, that reference the columns you want to delete it is impossible. Because you "wanting to remember" the values those cells had.

    One solution could be copy columns E:G and paste in the same columns as values. Then delete columns B:D.

    Or you could not delete columns B:D, just hide them.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: Avoid #REF! error when deleting columns

    OK. That is do-able.... but... why did the values for 17/11/23 change between the two sheets???

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: Avoid #REF! error when deleting columns

    No reply...


    1. Future date cells are blank. You'll need to enter dates manually, as you can't use +7 from a cell that you delete.

    2. There are new formulae in the purple cells.

    3. The purple block was selected and dragged to the right (I manually recoloured it orange for clarity).

    4. Add new values in the green cells.

    5. Do the calculated cells (orange) calcuate correctly?

    6. Delete columns B:D.

    7. Do the calculated (orange) cells still calculate correctly?
    Attached Files Attached Files

+ 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. [SOLVED] Macro Error When Deleting Columns and Rows
    By Allienne in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 09-19-2018, 11:23 AM
  2. Avoid PowerQuery refresh from deleting empty columns
    By Barslund in forum Excel General
    Replies: 10
    Last Post: 01-10-2018, 04:19 AM
  3. getting a ref error when deleting columns
    By greycamaro in forum Excel General
    Replies: 4
    Last Post: 05-05-2017, 01:29 AM
  4. Replies: 1
    Last Post: 04-30-2012, 12:07 PM
  5. VBA 1004 Error Deleting Rows or Columns
    By CaptMac in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-23-2010, 03:46 PM
  6. avoid "REF" error when deleting data
    By bshelman in forum Excel General
    Replies: 12
    Last Post: 09-20-2010, 09:13 AM
  7. [SOLVED] How to avoid deleting of rows
    By 2foot in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-05-2006, 05:00 AM

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