#N/A Values

c0087

Board Regular
Joined
Jul 13, 2015
Messages
85
Office Version
  1. 365
Platform
  1. Windows
11
#N/A2
#N/A3
24
3
#N/A
4

<tbody>
</tbody>

I have a bunch of #N/A values in columns. what's the easiest way to get the desired result (1234) in the adjacent column with no empty cells in between?
 
Last edited:

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
How about


Book1
AB
211
3#N/A2
4#N/A3
524
63
7#N/A
84
Master
Cell Formulas
RangeFormula
B2=IFERROR(INDEX($A$2:$A$8,AGGREGATE(15,6,(ROW($A$2:$A$8)-ROW($A$2)+1)/($A$2:$A$8<>"#N/A"),ROWS($A$1:$A1))),"")
 
Upvote 0
I'm not sure there is any way to characterize the "easiest way". If you do not need the data in Column B to be "live" (that is, changeable as values in Column A change), then this macro will avoid loading up the sheet with formulas...
Code:
Sub DeleteNAs()
  Columns("A").Copy
  Range("B1").PasteSpecial xlValues
  Columns("B").SpecialCells(xlConstants, xlErrors).Delete xlShiftUp
End Sub
 
Upvote 0
How about

AB
211
3#N/A2
4#N/A3
524
63
7#N/A
84

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Master

Worksheet Formulas
CellFormula
B2=IFERROR(INDEX($A$2:$A$8,AGGREGATE(15,6,(ROW($A$2:$A$8)-ROW($A$2)+1)/($A$2:$A$8<>"#N/A"),ROWS($A$1:$A1))),"")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

this formula gets rid of the N/A's but leaves an empty cell
 
Upvote 0
I'm not sure there is any way to characterize the "easiest way". If you do not need the data in Column B to be "live" (that is, changeable as values in Column A change), then this macro will avoid loading up the sheet with formulas...
Code:
Sub DeleteNAs()
  Columns("A").Copy
  Range("B1").PasteSpecial xlValues
  Columns("B").SpecialCells(xlConstants, xlErrors).Delete xlShiftUp
End Sub

Thank you this works perfect if I do decide to go that route, but I'd still rather a formula for now.
 
Last edited:
Upvote 0
It doesn't leave any empty cells for me.
Can you please post some data where you are getting blank cells
 
Upvote 0
Hi Fluff, Hi Rick,

How you been. A quick question. How about considering "Sort option" as the easiest way to get the desired result. :)
 
Upvote 0
How you been. A quick question. How about considering "Sort option" as the easiest way to get the desired result. :)
First, you would have to copy Column A values to Column B and then sort Column B as the OP wants the answer in the "adjacent column". Second, I assume you are implying to then select all of the #N/A cells and delete those cells (shifting the remaining values up). Yes, that might work depending on if the current order of the values needs to be maintained or not (the solutions so far preserves the current order whereas your suggestion would change their order).
 
Upvote 0
It doesn't leave any empty cells for me.
Can you please post some data where you are getting blank cells

i made an error when copying in it :mad:..

it works perfect! thank you so much
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,813
Messages
6,121,705
Members
449,048
Latest member
81jamesacct

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