Formula to list missing values

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569
How do i create a formula or macro that will list in the target range ck5:ck13 all values from the list in BW1:CF1, which are not listed in BW5:CF18
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Try the following...

CK5, copied down:

=INDEX($BW$1:$CF$1,SMALL(IF(COUNTIF($BW$5:$CF$18,$BW$1:$CF$1)=0,COLUMN($BW$1:$CF$1)-COLUMN($BW$1)+1),ROWS($CK$5:CK5)))

...confirmed with CONTROL+SHIFT+ENTER.

To include an error trap...

CJ5:

=SUMPRODUCT(--(COUNTIF(BW5:CF18,BW1:CF1)=0))

CK5, copied down:

=IF(ROWS($CK$5:CK5)<=$CJ$5,INDEX($BW$1:$CF$1,SMALL(IF(COUNTIF($BW$5:$CF$18,$BW$1:$CF$1)=0,COLUMN($BW$1:$CF$1)-COLUMN($BW$1)+1),ROWS($CK$5:CK5))),"")

...confirmed with CONTROL+SHIFT+ENTER. If you prefer to have one formula, try the following instead...

=IF(ROWS($CK$5:CK5)<=SUMPRODUCT(--(COUNTIF($BW$5:$CF$18,$BW$1:$CF$1)=0)),INDEX($BW$1:$CF$1,SMALL(IF(COUNTIF($BW$5:$CF$18,$BW$1:$CF$1)=0,COLUMN($BW$1:$CF$1)-COLUMN($BW$1)+1),ROWS($CK$5:CK5))),"")

...confirmed with CONTROL+SHIFT+ENTER. Note that having it in one formula is not as effficient.

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,196
Members
449,072
Latest member
DW Draft

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