Look up missing number and apply to where #N/A

hajiali

Well-known Member
Joined
Sep 8, 2018
Messages
626
Office Version
  1. 2016
Platform
  1. Windows
[TABLE="width: 500"]
<tbody>[TR]
[TD] Table 1[/TD]
[TD] Table 2[/TD]
[TD]Table 3[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 486"]
<tbody>[TR]
[TD][/TD]
[TD]DL[/TD]
[TD]DM[/TD]
[TD]DN[/TD]
[TD][/TD]
[TD]DL[/TD]
[TD]DM[/TD]
[TD]DN[/TD]
[TD][/TD]
[TD]DL[/TD]
[TD]DM[/TD]
[TD]DN[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]SHIFT[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]SHIFT[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]SHIFT[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD][/TD]
[TD]16[/TD]
[TD][/TD]
[TD]1[/TD]
[TD][/TD]
[TD]16[/TD]
[TD][/TD]
[TD]1[/TD]
[TD][/TD]
[TD]16[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2[/TD]
[TD][/TD]
[TD]17[/TD]
[TD][/TD]
[TD]2[/TD]
[TD][/TD]
[TD]17[/TD]
[TD][/TD]
[TD]2[/TD]
[TD][/TD]
[TD]17[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]#N/A[/TD]
[TD]16[/TD]
[TD]18[/TD]
[TD][/TD]
[TD]#N/A[/TD]
[TD]18[/TD]
[TD]18[/TD]
[TD][/TD]
[TD]#N/A[/TD]
[TD]16[/TD]
[TD]18[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]3[/TD]
[TD][/TD]
[TD]19[/TD]
[TD][/TD]
[TD]3[/TD]
[TD][/TD]
[TD]19[/TD]
[TD][/TD]
[TD]3[/TD]
[TD][/TD]
[TD]19[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD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TD]
[TD]33[/TD]
[TD][/TD]
[TD]#N/A[/TD]
[TD]33[/TD]
[TD]33[/TD]
[TD][/TD]
[TD]#N/A[/TD]
[TD]16[/TD]
[TD]33[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]6[/TD]
[TD][/TD]
[TD]34[/TD]
[TD][/TD]
[TD]6[/TD]
[TD][/TD]
[TD]34[/TD]
[TD][/TD]
[TD]6[/TD]
[TD][/TD]
[TD]34[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]4[/TD]
[TD][/TD]
[TD]35[/TD]
[TD][/TD]
[TD]4[/TD]
[TD][/TD]
[TD]35[/TD]
[TD][/TD]
[TD]4[/TD]
[TD][/TD]
[TD]35[/TD]
[/TR]
[TR]
[TD]16[/TD]
[TD]#N/A[/TD]
[TD]29[/TD]
[TD]36[/TD]
[TD][/TD]
[TD]#N/A[/TD]
[TD]36[/TD]
[TD]36[/TD]
[TD][/TD]
[TD]#N/A[/TD]
[TD]16[/TD]
[TD]36[/TD]
[/TR]
[TR]
[TD]17[/TD]
[TD]21[/TD]
[TD][/TD]
[TD]37[/TD]
[TD][/TD]
[TD]21[/TD]
[TD][/TD]
[TD]37[/TD]
[TD][/TD]
[TD]21[/TD]
[TD][/TD]
[TD]37[/TD]
[/TR]
[TR]
[TD]18[/TD]
[TD]23[/TD]
[TD][/TD]
[TD]38[/TD]
[TD][/TD]
[TD]23[/TD]
[TD][/TD]
[TD]38[/TD]
[TD][/TD]
[TD]23[/TD]
[TD][/TD]
[TD]38[/TD]
[/TR]
[TR]
[TD]19[/TD]
[TD]#N/A[/TD]
[TD]30[/TD]
[TD]39[/TD]
[TD][/TD]
[TD]#N/A[/TD]
[TD]39[/TD]
[TD]39[/TD]
[TD][/TD]
[TD]#N/A[/TD]
[TD]16[/TD]
[TD]39[/TD]
[/TR]
</tbody>[/TABLE]

Hey everyone my plan here is to find the missing numbers in Column DL and place the missing number anywhere that #N/A is in DL into column DM as shown in the table 1 Far Left above. I was able to figure out how to find the missing Number which is in column DN just for visual purpose.

in DM2= IF(ISNA(DL2)),SMALL(IF(COUNTIF($DL$1:$DL$130,ROW($1:$130))=0,ROW($1:$130),""),ROW(DL1))," ")

That will give me the first missing numbers in DM2 is 16, however, if DL2 and DL3 are not "#N/A" as shown above it puts 18 in DL4 instead of the first missing number 16. with above eq it puts the # in DN adjacent to DM ex DM3=DN3, DM4=DN4, DM5=DN5...ETC as shown in the Middle table Table 2 above. it does not give me the first missing number as it should. If i put $ sign at the end of the eq. ", ROW(DL$1, " ") and then drag in DM it gives me First missing number 16 in All column in DM as shown in the Far Right table 3. Any suggestion is greatly appreciated if you have any question please dont hesitate to ask.
 
Last edited:

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,223,705
Messages
6,173,985
Members
452,540
Latest member
haasro02

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