PC Review


Reply
Thread Tools Rate Thread

How do I loop in EXCEL !! Pls EX-cel-erate me!!

 
 
bones288
Guest
Posts: n/a
 
      19th Apr 2008

1.Have to compare contents of 2 cells.

2. IS cell1 same as cell2 ?

3. If yes: then copy 2 cells of cell2 into cell1.

4. If no: then compare cell1 to the next cell in line after cell2.

4b. Now IS cell1 same as cell2b?

5. If yes: then copy 2 cells of cell2b into cell1.

6. Next cell1

7. IS new cell1 the same as cell2?

8. Repeat until cell1 = 'end of filled column' OR cell2= 'end of
filled column' OR (loop >total count of cell1 column).
note: =IF(cell1=end&&cell2=end) THEN good routine ELSE 'error
routine'.


Example:

Two excel columns in two different worksheets:

a1-worksheet1 a1-worksheet2
alan paul
randy alex
rica sarah
todd sigmund

I want to compare all of the name in the first 'worksheet column' to
the names in the second 'worksheet column'.

Where we find a matching set of name (not necessarily in the same
locations; row# x column#) we want to match the contents of 2 cells in
either worksheet to the contents of the other.

before
alan 23 14_oak_lane alan

after
alan 23 14_oak_lane alan 23 14_oak_lane



 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      19th Apr 2008
Not sure I follow but if this is what you want -

On Sheet1 you have a list of names in col-A with two address fields in Col-B
and Col-C
On sheet 2 in col_A you also have a list of names. A name may or may not
match any in Sheet1 but if it does put the matching address in Col-B and
Col-C.

on Sheet2
in B1: =VLOOKUP($A1,Sheet1!A1:C100,2,FALSE)
in C1: =VLOOKUP($A1,Sheet1!A1:C100,3,FALSE)

change A1:C100 to the location and size of your table on sheet1
drag the formulas down

copy the formula cells and pasteSpecial values back to keep the values
without the formulas.

Regards,
Peter T


"bones288" <(E-Mail Removed)> wrote in message
news:49f24a4d-a39a-49b5-ba5c-(E-Mail Removed)...
>
> 1.Have to compare contents of 2 cells.
>
> 2. IS cell1 same as cell2 ?
>
> 3. If yes: then copy 2 cells of cell2 into cell1.
>
> 4. If no: then compare cell1 to the next cell in line after cell2.
>
> 4b. Now IS cell1 same as cell2b?
>
> 5. If yes: then copy 2 cells of cell2b into cell1.
>
> 6. Next cell1
>
> 7. IS new cell1 the same as cell2?
>
> 8. Repeat until cell1 = 'end of filled column' OR cell2= 'end of
> filled column' OR (loop >total count of cell1 column).
> note: =IF(cell1=end&&cell2=end) THEN good routine ELSE 'error
> routine'.
>
>
> Example:
>
> Two excel columns in two different worksheets:
>
> a1-worksheet1 a1-worksheet2
> alan paul
> randy alex
> rica sarah
> todd sigmund
>
> I want to compare all of the name in the first 'worksheet column' to
> the names in the second 'worksheet column'.
>
> Where we find a matching set of name (not necessarily in the same
> locations; row# x column#) we want to match the contents of 2 cells in
> either worksheet to the contents of the other.
>
> before
> alan 23 14_oak_lane alan
>
> after
> alan 23 14_oak_lane alan 23 14_oak_lane
>
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop in Excel Kahn Microsoft Excel Programming 1 7th May 2010 03:48 AM
How do I loop in EXCEL !! Pls EX-cel-erate me!! bones288 Microsoft Excel Programming 1 19th Apr 2008 02:56 PM
Re: If loop for excel Always Learning Microsoft Excel Discussion 0 13th Aug 2004 12:07 PM
If loop for excel Frank abel Microsoft Excel Discussion 0 13th Aug 2004 10:37 AM
Excel VBA loop until eof wombatz Microsoft Excel Programming 6 14th Jan 2004 01:11 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:38 AM.