Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Lookup and return any missing numbers if applicable

Is it possible to write a formula that will autopopulate a column with any
missing numbers. I believe it should be something really simple, but I can't
get it to work.

Example: Sheet x, column A - contains employee numbers
Sheet y, column A - contains employee numbers

I want to update Sheet x, column A with any employee numbers that are on
Sheet y and not sheet x.

Thank you in advance.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Lookup and return any missing numbers if applicable

Try running this simple macro:

Sub GetUm()
Set x = Sheets("x")
Set y = Sheets("y")
xn = x.Cells(Rows.Count, "A").End(xlUp).Row
yn = y.Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To yn
v = y.Cells(i, "A").Value
Set LookRange = x.Range("A1:A" & xn)
k = Application.WorksheetFunction.CountIf(LookRange, v)
If k = 0 Then
xn = xn + 1
x.Cells(xn, "A").Value = v
End If
Next
End Sub

--
Gary''s Student - gsnu200852


"Chel" wrote:

Is it possible to write a formula that will autopopulate a column with any
missing numbers. I believe it should be something really simple, but I can't
get it to work.

Example: Sheet x, column A - contains employee numbers
Sheet y, column A - contains employee numbers

I want to update Sheet x, column A with any employee numbers that are on
Sheet y and not sheet x.

Thank you in advance.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 24
Default Lookup and return any missing numbers if applicable

A formula way, try :

1] Assume your datas located at "Sheet x, A1:A20" and "Sheet y, A1:A20"

2] Sheet x, A21, enter the array formula and filled down :

{=INDEX('Sheet y'!A:A,SMALL(IF(ISERROR(MATCH('Sheet
y'!A$1:A$20,$A$1:$A$20,0)),ROW($1:$20),65000),ROW( 1:1)))&""}


Regards
Bosco


"Chel" wrote:

Is it possible to write a formula that will autopopulate a column with any
missing numbers. I believe it should be something really simple, but I can't
get it to work.

Example: Sheet x, column A - contains employee numbers
Sheet y, column A - contains employee numbers

I want to update Sheet x, column A with any employee numbers that are on
Sheet y and not sheet x.

Thank you in advance.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom format applicable to negative and positive numbers? J. Excel Discussion (Misc queries) 5 November 11th 08 09:07 PM
lookup range of numbers; return corresponding data for the fixed r mmpfa07 Excel Worksheet Functions 1 May 2nd 07 07:33 PM
BIFF - Help!! lookup numbers in multiple columns and return one nu JB Excel Worksheet Functions 6 October 23rd 06 02:56 PM
LOOKUP and return the column heading for IF/THEN return for False NN Excel Discussion (Misc queries) 1 October 6th 06 11:24 AM
to find missing serial numbers in randomly generated numbers B.H. Hadi Excel Worksheet Functions 2 December 1st 05 10:56 PM


All times are GMT +1. The time now is 12:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"