+ Reply to Thread
Results 1 to 3 of 3

Searching& applying a dummy

Hybrid View

cj21 Searching& applying a... 09-14-2010, 08:44 AM
NBVC Re: Searching& applying a... 09-14-2010, 09:05 AM
cj21 Re: Searching& applying a... 09-14-2010, 09:20 AM
  1. #1
    Forum Contributor
    Join Date
    07-28-2005
    Posts
    151

    Searching& applying a dummy

    Hi

    I have attached an Excel file which illustrates my problem.

    I have data with two columns. The first column is a student code. The second column tells me what subjects the student has studied in the past. In reality the dataset is huge.

    I want to create 2 new variables: one called Economics and the other called Mathematics.

    What I need is a formula that searches the student code and tells me whether that sudent has done Economics in the past. If they have that student gets a score of 1 for the new variable if not they get a 0. This would be the same for the Mathematics variable.

    The spreadsheet attached illustrates my problem with 5 students. I have filled it out manually.I hope someone can help me.

    Best wishes

    Chris
    Attached Files Attached Files
    Last edited by NBVC; 09-14-2010 at 09:58 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Searching& applying a dummy

    In XL2007 and later:

    =--(COUNTIFS($A$2:$A$26,$A2,$B$2:$B$26,C$1)>0)

    in Pre-XL2007:

    =--(SUMPRODUCT(--($A$2:$A$26=$A2),--($B$2:$B$26=C$1))>0)


    both copied down and to next column
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    07-28-2005
    Posts
    151

    Re: Searching& applying a dummy

    That's great

    Thankyou so much.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1