Find missing values in two lists

bujubenji

New Member
Joined
Feb 26, 2023
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Hi all,

This should be a simple problem but I seem unable to sort it:

I have a list of numerical and word product codes in B44:B60, e.g HJK/5566712/19

A macro button on each row can copy the data from B44 over to H44 when sent to another department.

Hitting the button again undoes the previous action.

Starting on K44- I want to create a list of outstanding entries from list H44- i.e. which values from B44:B60 DO NOT appear in H44:H60.

I've tried a couple of methods- namely in K44, I have used the following function:

=Filter(B44:B60,NOT(COUNTIF(H44:H60,B44:B60)))

Which works initially- however, if I remove data from H44:H60, the filtering array automatically changes to become the last row in column H i.e. If I remove data from H50, the formula rewrites to

Filter(B44:B60,NOT(COUNTIF(H44:H50,B44:B60))).

If all data is removed, it returns a #Ref error.

I have tried using absolute references and named ranges in place of the cell ranges, but these problems still occur- where am I going wrong?

I've resorted to using VBA which I adapted from a similar thread but really want to understand where I went wrong with the filter function, thanks for any help you can give.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
If you remove one cell or several cells and choose Shift cells up. Formulas and ranges automatically adjust to the new range of cells.

If you want to keep the same range in the formulas, you shouldn't remove the cells like that, just delete the data from the cell.

varios 14jul2023.xlsm
BH
44HJK/5566712/19HJK/5566712/19
45HJK/5566712/20HJK/5566712/20
46HJK/5566712/21HJK/5566712/22
47HJK/5566712/22
48HJK/5566712/23HJK/5566712/25
49HJK/5566712/24HJK/5566712/26
50HJK/5566712/25
51HJK/5566712/26HJK/5566712/29
52HJK/5566712/27HJK/5566712/30
53HJK/5566712/28
54HJK/5566712/29HJK/5566712/33
55HJK/5566712/30
56HJK/5566712/31
57HJK/5566712/32
58HJK/5566712/33
59HJK/5566712/34
60HJK/5566712/35
Hoja4


If you have blank cells among your data, sort your list from smallest to largest and the blank cells will be at the bottom.

1689359590682.png


I hope that helps you.
:giggle:
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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