+ Reply to Thread
Results 1 to 4 of 4

if then statement

Hybrid View

  1. #1
    Registered User
    Join Date
    10-18-2008
    Location
    michigan
    MS-Off Ver
    2010
    Posts
    88

    if then statement

    Hi,

    What do I change in the following formula to get it to work?

    HTML Code: 
    If C1=abc and G1= def, then add D1
    If C1=abc and G1= ghi, the subtract D1
    If not then leave blank


    Mike

  2. #2
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: if then statement

    =IF(AND(C1="abc",G1="def"),+D1,IF(AND(C1="abc",G1="ghi"),-D1,""))
    Regards
    Sean

    Please add to my reputation if you think i helped
    (click on the star below the post)
    Mark threads as "Solved" if you have your answer
    (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code:
    [code] Your code here [code]
    Please supply a workbook containing example Data:
    It makes its easier to answer your problem & saves time!

  3. #3
    Registered User
    Join Date
    10-18-2008
    Location
    michigan
    MS-Off Ver
    2010
    Posts
    88

    Re: if then statement

    Hi Sean Thomas,ragavan.sridar1

    I keep forgetting about the "and"

    Thanks for the help


    Mike

  4. #4
    Forum Contributor ragavan.sridar1's Avatar
    Join Date
    11-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010, Excel 2003
    Posts
    208

    Re: if then statement

    Check this.
    HTML Code: 
    Thanks!
    Raga.

    Please,mark your thread [SOLVED] if you received your answer.

    Click the little star * below, to give some Rep if you think an answer deserves it.

    I learnt so many things from these links.

+ 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