+ Reply to Thread
Results 1 to 6 of 6

how to write this if statement correctly

  1. #1
    Registered User
    Join Date
    10-25-2012
    Location
    here
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    11

    how to write this if statement correctly

    Hi

    I'm pretty sure I need an if statement but don't know how to work them.

    Here is what I need to happen

    In cell AC7 I need a sum
    If F7 = greater than 1.49 then 1 if less than then 0 + If J7 = greater than 1.49 then 1 if less than then 0 + If P7 = greater than 1.49 then 1 if less than then 0 + If T7 = greater than 1.49 then 1 if less than then 0 + If X7 = greater than 1.49 then 1 if less than then 0
    Last edited by greg123; 10-20-2016 at 01:29 AM. Reason: the boss said I had to change stuff

  2. #2
    Registered User
    Join Date
    10-25-2012
    Location
    here
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    11

    Re: if statement ( I think)

    Also need it to come up blank if the total is zero

  3. #3
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,923

    Re: if statement ( I think)



    =IF(MAX(F7,J7,P7,X7)>1.49,1,0)

  4. #4
    Forum Contributor
    Join Date
    02-04-2014
    Location
    NSW, Australia
    MS-Off Ver
    Excel 2010
    Posts
    136

    Re: if statement ( I think)

    A bit long winded but:

    =IF(F7>1.49,1,0)+IF(J7>1.49,1,0)+IF(T7>1.49,1,0)+IF(X7>1.49,1,0)

  5. #5
    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,946

    Re: if statement ( I think)

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem - not what you think the answer might be. (think google search terms?). Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the address bar)

    Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (note: this change is not optional )
    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

  6. #6
    Registered User
    Join Date
    10-25-2012
    Location
    here
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    11

    Re: how to write this if statement correctly

    Change made,

    Thanks lcartwright that is what I needed.

+ 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. [SOLVED] i have an if then statement that works, how to make it work as a with or case statement
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-03-2016, 03:34 PM
  2. Replies: 2
    Last Post: 07-09-2015, 04:25 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