Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Excel Formula Question

Is there a formula which will compare cells between 2 worksheets and then is
they match add from another cell? For example, I have 2 worksheets and each
worksheet has the same user ID. However 2nd worksheet has the user ID more
than once (which is fine). What I want to do is if they are equal then add
the segment ID from another cell from worksheet 1.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 154
Default Excel Formula Question

Chris,

A little confused, but I can try to help.

Your first sheet will contain the "Segment ID" and the "User ID"? Say:
User Segment
123 1
124 2
125 3
126 4

Your second sheet will contain the "User ID" multiple times, and you want it
to pull the "Segment ID"? Say:
User Segment (Formula)
123 1
123 1
124 2
125 3
125 3
126 4
126 4
126 4


"Chris N" wrote:

Is there a formula which will compare cells between 2 worksheets and then is
they match add from another cell? For example, I have 2 worksheets and each
worksheet has the same user ID. However 2nd worksheet has the user ID more
than once (which is fine). What I want to do is if they are equal then add
the segment ID from another cell from worksheet 1.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Excel Formula Question

Given the following layout on Sheet1:

A B C
1
2
3 John
4 Jim
5 Wilbur
6 Ralph
7 Jane
8 Mary
9 John

and this setup on Sheet2
A B C
1
2 John ID-Jo
3 Jim ID-Ji
4 Wilbur ID-W
5 Ralph IDR

Then either of these formulas in cell D3 on Sheet2 (or any cell on Sheet2
for that matter) and filled down will work:
Easier (remember in Excel this would not be on 2 lines)
=IF(ISNA(VLOOKUP(C3,Sheet1!A$2:A$5,1,FALSE)),"",C3 & " " &
VLOOKUP(C3,Sheet1!A$2:C$5,3,FALSE))

or more complex but with the same results:
=IF(ISNA(VLOOKUP(C3,Sheet1!A$2:A$5,1,FALSE)),"",C3 & " " &
INDEX(Sheet1!C$2:C$5,MATCH(C3,Sheet1!A$2:A$5,0),1) )

For understanding more of what's going on use Excel Help for the particular
function as VLOOKUP, MATCH, INDEX, or ISNA. Basically the ISNA() portion
says that if it cannot find a match, return a blank cell, otherwise take
what's on a row on Sheet2 and add what's in a cell 3 columns over from column
A of the matched row on Sheet1, and put a space in between the values for
appearance sake.


"Chris N" wrote:

Is there a formula which will compare cells between 2 worksheets and then is
they match add from another cell? For example, I have 2 worksheets and each
worksheet has the same user ID. However 2nd worksheet has the user ID more
than once (which is fine). What I want to do is if they are equal then add
the segment ID from another cell from worksheet 1.

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
Excel Formula Question! Killer Excel Discussion (Misc queries) 3 September 23rd 07 03:14 AM
Excel formula question fletch17 Excel Worksheet Functions 2 September 10th 07 01:14 PM
Question about a formula (Excel XP) Mike Webb New Users to Excel 4 July 28th 06 02:17 PM
Excel Formula Question Sum Limit and marking Excel Worksheet Functions 2 June 26th 06 08:55 PM
Excel Formula Question Joyce Excel Worksheet Functions 2 November 2nd 04 09:37 PM


All times are GMT +1. The time now is 10:54 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"