+ Reply to Thread
Results 1 to 4 of 4

Multiply cell by a number dependent on criteria

  1. #1
    Registered User
    Join Date
    12-10-2011
    Location
    Madison, WI
    MS-Off Ver
    Excel 2010
    Posts
    1

    Multiply cell by a number dependent on criteria

    "In order to perform a separate equations regression for males and females, we will need to create an indicator variable for either males or for females. In order to create an indicator variable for males, in cell J2 use the following command.
    =IF(G2="M",1,0)
    This will result in a 1 for males and a 0 for females. We will also need to multiply this zero/one column of numbers by the values in the GPA column. The result will be a column that will repeat the value of GPA if the gender is male, otherwise there will be a zero."

    These are the instructions I was given, however I am having difficulty creating the excel command. I need to create a command that, if cell G2 came up as "male," multiplies the GPA (in cell I2) by one. It also needs to multiply the GPA by zero if the cell G2 comes up as "female." I've attached an image to give you some sort of idea.

    https___uwmad.courses.wisconsin.edu_content_enforced_1479144-stat301_006_fa11_Project 3 - Separa.jpg

    Thanks, and help!!

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Multiply cell by a number dependent on criteria

    Good morning.

    Try this formula:

    =IF(OR(J2=1;J2=0);SUM(I2*J2))

    Hore to helps you.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Multiply cell by a number dependent on criteria

    Hi allisonkristyne,

    For desired result, use following formula in column M :-
    Please Login or Register  to view this content.

    Regards,
    DILIPandey

    < click on below 'Star' if this helps >
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Multiply cell by a number dependent on criteria

    One more way:

    =LOOKUP(G2,{"F","M"},{0,1})*I2
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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