+ Reply to Thread
Results 1 to 8 of 8

IF statement help

  1. #1
    Registered User
    Join Date
    01-28-2016
    Location
    Stoke, England
    MS-Off Ver
    2016
    Posts
    24

    IF statement help

    Hi guys,

    How do I get excel to do the following in Cell E1:

    If the text in cell A1 equals the letter A and the value of B1 – the Value in C1 is greater than 0 then multiply it by D1. Else E1 = 0

    I hope that explanation makes sense, I tried to enter the data into a table but I kept getting directed to a site that had “Sucuri WebSite Firewall - CloudProxy - Access Denied” written on it.
    Last edited by JonnyEnglish; 01-21-2017 at 12:51 PM. Reason: Spelling mistake

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,686

    Re: IF statement help

    =IF( AND ( A1="A", B1 = ???? , C1 > 0) , D1 * what ? , E1=0


    actually not sure I understand

    If the text in cell A1 equals the letter A
    and the value of B1 –
    the Value in C1 is greater than 0

    then multiply it by D1. Else E1 = 0

    If you are changing E1 based on E1 values - you will need VBA to do that , i think
    an IF will not change E1 based on E1 as it will get a circular reference

    IE

    If the text in cell A1 equals the letter A
    and the value of B1 = E1
    the Value in C1 is greater than 0

    then multiply E1 by D1. Else E1 = 0

    is that what you want
    Last edited by etaf; 01-21-2017 at 01:54 PM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: IF statement help

    Maybe this - IF I understand?

    E1=if(and(A1="A",B1-C1>0),something*D1,0)

    You did not specify what to * D1 by, so substitute what you need there
    If the text in cell A1 equals the letter A and the value of B1 – the Value in C1 is greater than 0 then multiply it by D1. Else E1 = 0
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,686

    Re: IF statement help

    ok, now that FDibbins posted , i have read the line differently


    If the text in cell A1 equals the letter A and the value of B1 – the Value in C1 is greater than 0 then multiply it by D1. Else E1 = 0

    E1
    =IF ( AND( A1="A", (B1-C1)>0 ) , (B1-C1)*D1 , 0 )

  5. #5
    Registered User
    Join Date
    01-28-2016
    Location
    Stoke, England
    MS-Off Ver
    2016
    Posts
    24

    Re: IF statement help

    Hey guys, thanks for the responses, I’ve tried to reword it.
    E1 is where I’d like the result to be displayed so:
    IF
    A1 = “A” AND the result of B1-C1 is greater than 0
    THEN
    Multiply that result by D1
    IFNOT
    Place 0 in E1

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,686

    Re: IF statement help

    see my previous post

    ops

    B1*C1
    or
    B1 - C1

    =IF ( AND( A1="A", (B1-C1)>0 ) , (B1-C1)*D1 , 0 )
    =IF ( AND( A1="A", (B1*C1)>0 ) , (B1*C1)*D1 , 0 )

  7. #7
    Registered User
    Join Date
    01-28-2016
    Location
    Stoke, England
    MS-Off Ver
    2016
    Posts
    24

    Re: IF statement help

    Thank you guys!
    =IF ( AND( A1="A", (B1-C1)>0 ) , (B1-C1)*D1 , 0 )
    Is what I was looking for

  8. #8
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,686

    Re: IF statement help

    you are welcome, thanks for the rep

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 07-09-2015, 04:25 PM
  2. [SOLVED] If statement to select data - nested statement - assistance
    By petitesouris in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-29-2015, 09:55 PM
  3. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  4. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  5. Replies: 4
    Last Post: 06-01-2012, 10:05 AM
  6. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  7. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 PM

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