Google Sheets: How to delete rows with #REF! error while referencing other rows from a different sheet

RicardoRincon

New Member
Joined
Jan 28, 2022
Messages
5
Office Version
  1. 2021
Platform
  1. Windows
I think the solution must be simple. So I have two sheets, one with data that is added every time a new order is made, Column A is the Brand Name and column B is the Order Name for that brand. In the second sheet I reference Column A and B of the first sheet to have the exact same data, brand name and order name, the other columns in the second sheet are other calculations that I make for the specific Order, but I think that's irrelevant for my problem. My problem is that when data is eliminated in either columns A or B or an entire row is eliminated in the first sheet, I get a #REF! error in the relevant row of the second sheet and the reference formula of the entire column skips this row with the #REF! error. So the optimal scenario would be for the entire row that gives #REF! error to be eliminated and to prevent it from being skipped from the reference formula to the other sheet. I hope this makes sense, I will attach both sheets to have a better understanding.

1643387277639.png


1643387328948.png


When I eliminate highlighted row...

1643387488774.png
 
Last edited by a moderator:

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hello you should have the filter function available in Excel 2021.

If you extract A & B columns with filter, deleting rows doesn't affect the extracted rows. Enter this in A2 on Lead Time Def tab.

This will extract 500 rows, extend your Cadena Column A range in Filter formula as required;

Excel Formula:
=FILTER(Cadena!$A$4:$B$500,Cadena!$A$4:$A$500<>"","")
 
Upvote 0
Hello you should have the filter function available in Excel 2021.

If you extract A & B columns with filter, deleting rows doesn't affect the extracted rows. Enter this in A2 on Lead Time Def tab.

This will extract 500 rows, extend your Cadena Column A range in Filter formula as required;

Excel Formula:
=FILTER(Cadena!$A$4:$B$500,Cadena!$A$4:$A$500<>"","")
Thank you so much for your reply RasGhul,

I tried what you recommended, but excel gave me an #N/A error that says:

FILTER has mismatched range sizes. Expected row count: 497. column count: 1. Actual row count: 1, column count: 1.

If you have any idea I would appreciated greatly
 
Upvote 0
Okay we can use the old method, this will also return 500 rows, extend your ranges just to cover your total Cadena rows sheet.

My sample data but same application;

Cell Formulas
RangeFormula
A2:A20A2=IF(ROWS($A$2:A2)>COUNTA(Cadena!$A$2:$A$500),"",INDEX(Cadena!$A$2:$A$500,SMALL(IF(Cadena!A:A<>"",ROW(Cadena!$A$2:$A$500)-ROW(Cadena!$A$1)),ROWS($A$2:A2))))
B2:B20B2=IF(ROWS($B$2:B2)>COUNTA(Cadena!$A$2:$A$500),"",INDEX(Cadena!$B$2:$B$500,SMALL(IF(Cadena!A:A<>"",ROW(Cadena!$A$2:$A$500)-ROW(Cadena!$A$1)),ROWS($B$2:B2))))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Solution
OMG IT WORKED!!! Now columns A and B don't give me errors when deleting rows in the first sheet. But sadly columns C, D and E do give the same REF error. I mean I guess we need to do the same for them? Column C gives the date for when someone marks a check, Column D does the same, And E substracts the dates to have a duration, simple. But I don't know how to integrate your formula on them ?.

Formula column C:
1643809929967.png


Formula column D:
1643809974507.png


Formula column E:
1643810027596.png


YOU HAVE BEEN A LIFE SAVER RashGul
 

Attachments

  • 1643810000083.png
    1643810000083.png
    3.2 KB · Views: 13
Upvote 0
Are you using Excel, or Google Sheets?
 
Upvote 0
Google sheets
Be sure to clearly mention that in your title and/or initial question posting (while Excel and Google Sheets are similar, they are NOT the same, and have differences).

Also, do not post the question in the "Excel Questions" forum, but rather the "General Discusison & Other Applications" forum (note the description).
1643812600392.png


I have moved the thread for you and updated the thread title.
 
Upvote 0

Forum statistics

Threads
1,223,362
Messages
6,171,642
Members
452,415
Latest member
mansoorali

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top