+ Reply to Thread
Results 1 to 10 of 10

IF / THEN question

Hybrid View

  1. #1
    Registered User
    Join Date
    05-14-2012
    Location
    Den Haag, Netherlands
    MS-Off Ver
    Excel 2011
    Posts
    3

    Question IF / THEN question

    Hello,

    I'm fairly new to the world of excel. I've been browsing the forum for quite a while, but I'm finding it hard to find a solution to my specific question.
    I'd like to do the following:
    - If D2 is Name1, then F2 = 50% of C2.
    - If D2 is Name2, then G2 = 50% of C2.

    Thanks so much already in advance!

    Liz

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: IF / THEN question

    Try

    =IF(OR(D2={"Name1","Name2"}),C2*0.5,"")
    HTH
    Regards, Jeff

  3. #3
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: IF / THEN question

    Hello there,

    I believe the below formulas should do it:

    F2 =IF(D2="Name1",C2*0.5,"")
    where you would replace the last "" with either text between the apostrophes or a calculation you would like to appear in F2 if D2 is not "Name1". Right now it states to show nothing.

    G2 =IF(D2="Name2",C2*0.5,"")
    where you would replace the last "" with either text between the apostrophes or a calculation you would like to appear in F2 if D2 is not "Name2". Right now it states to show nothing.

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: IF / THEN question

    That's not it Jeff. It's 2 separate formulas in F2 and G2.

  5. #5
    Registered User
    Join Date
    05-07-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2003 and Excel 2007
    Posts
    62

    Re: IF / THEN question

    Hi Liz,

    Are you looking for solution in VBA or Excel?
    Both the statements are almost same:
    - If D2 is Name1, then F2 = 50% of C2.
    - If D2 is Name2, then G2 = 50% of C2.
    Please click on the * if resolution works for you

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: IF / THEN question

    @Cutter,

    And I knew that I just blanked out

    F2=IF(D2="Name1",C2*0.5,"")

    G2=IF(D2="Name2",C2*0.5,"")

  7. #7
    Registered User
    Join Date
    05-14-2012
    Location
    Den Haag, Netherlands
    MS-Off Ver
    Excel 2011
    Posts
    3

    Re: IF / THEN question

    Thank you already for the quick replies. I used the codes you gave me, but I'm getting an error.
    I've attached the document for you to see.
    Attached Files Attached Files

  8. #8
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: IF / THEN question

    Take the quotes off of the formula. Should look like

    =IF(D2="Lisanne",C2*0.5,"")
    Last edited by jeffreybrown; 05-14-2012 at 09:43 AM.

  9. #9
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: IF / THEN question

    Remove the quotation marks around the C2*0.5

  10. #10
    Registered User
    Join Date
    05-14-2012
    Location
    Den Haag, Netherlands
    MS-Off Ver
    Excel 2011
    Posts
    3

    Re: IF / THEN question

    Got it! Thanks very much guys!
    I appreciate it.

    Liz

+ 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