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

B

bones288

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
 
P

Peter T

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top