+ Reply to Thread
Results 1 to 8 of 8

Help with an =If statement

Hybrid View

  1. #1
    Registered User
    Join Date
    05-16-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    8

    Help with an =If statement

    I've been back-testing a stock pattern and I'm having trouble getting my one of my columns to read give me the value I want. I want the following to be true if all of these conditions are met:

    F3>0

    G3>0

    J3<F3

    J3>0 and J3<11


    Here is what I have: =IF(F3>0,"X",IF(G3>0,"X",IF(J3<F3,"X",IF(AND(J3>0,J3<11),1,"X"))))

    The only part of the code that isn't working is the J3<F3. In other words, I noticed in one of my cells I had a 1 in J3, but when I added a 2 to F3 the cell came back as X (false).

    I also tried: =IF(J3<F3,AND(F3>0,AND(G3>0,AND(J3>1,J3<11),1,"X"))) but this just gave me the word "false" which isn't what I want. I want a 1 for true, and X for false.

    Any help is appreciated.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,651

    Re: Help with an =If statement

    Not 100% understanding, but try:

    =IF(AND(F3>0,G3>0,J3<F3,J3>0,J3<11),1,"X")
    Quang PT

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,651

    Re: Help with an =If statement

    Or shorter, with J3>0 and F3>J3, then F3>0 is unneeded

    =IF(AND(G3>0,J3<F3,J3>0,J3<11),1,"X")

  4. #4
    Registered User
    Join Date
    05-16-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Help with an =If statement

    Nah, that wasn't it, still looking.

    Basically, I'm trying to identify times where price action produces a signal. Then,I'm watching 2 price targets,
    and then an area lower below the signal. I want the cell to tell me when price goes straight up to price target
    1 without going down to the lower zone. The problem I'm having is any time that price action goes up to PT1, then
    back down to lower zone, it invalidates my current formula.

    Super annoying. If I can clarify anything to make it clearer, let me know.

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,651

    Re: Help with an =If statement

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  6. #6
    Registered User
    Join Date
    05-16-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Help with an =If statement

    Okay, I'm attaching the example that tipped me off. Cells F2 and G2 comprise of a zone where I would consider entries("E1" and "E2"), J2, K2, and L2 are price targets (PT1-3). In this example, price went up and touched PT1 and PT2, but not PT3, so cells J2 and K2 got a "1" for the number of days it took to reach those PTs. But then price came back down below "E1" and "E2" a few days later.

    Cell V2 is the formula in question. It is supposed to be a true/false on whether price action hit PT1 without hitting E1/E2, and within 10 days from the signal. Basically, this cell is telling my whether or not price skipped my entry zone or not within a period of 10 days. It should read as a "1" as it is true in this case. Price action didn't hit E1/E2 until 4 days after hitting PT1, but currently produces an "X" (false).

    Thanks again, let me know if I can explain anything else.
    Attached Files Attached Files

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,651

    Re: Help with an =If statement

    It is so hard to understand. Column M to V contain formulas those might be not working.
    What I need is the MANUAL INPUT for each scenarios of Es and PTs.
    Fill in scenarios template I made in attachment.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    05-16-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Help with an =If statement

    Whoops, meant to post this last night. Here are the scenarios.
    Attached Files Attached Files

+ 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] IF Statement with Multi-Criteria Statement inside a Data Validation List
    By dharvey1978 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-31-2020, 09:10 PM
  2. [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
  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