+ Reply to Thread
Results 1 to 5 of 5

Need Help with IF/AND/OR Function

  1. #1
    Registered User
    Join Date
    03-17-2021
    Location
    Hyderabad
    MS-Off Ver
    2016
    Posts
    3

    Need Help with IF/AND/OR Function

    Hi Folks,

    Can Anyone Help me with getting this fixed in Excel? I tried the variations mention below and many more but all are getting error in excel.

    =IF(AND C2="LONG", IF(P2>J2,"WIN","LOSS"), OR(C2="SHORT", (P2<J2,"WIN","LOSS")

    =IF(AND(C2="LONG", P2>J2,)"WIN", IF(C2="LONG", P2<J2,)"LOSS", IF(AND(C2="SHORT", P2<J2,)"WIN",IF(C2="LONG", P2>J2,)"LOSS"

    =IF(C2="LONG", (P2>J2, "WIN", IF(C2="LONG", ( P2<J2, "LOSS", IF(C2="SHORT", (P2<J2, "WIN", IF(C2="SHORT", P2>J2, "LOSS")))))))

    This is for my trading journal. Basically what I need is If I am taking a buy(LONG) position, it should be a win if P2>J2. Similarly for a Sell(SHORT) position it should be a win if P2<J2. C2 has the type of the position LONG/SHORT.

    Would be very thankful for any help.

  2. #2
    Forum Guru Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2010 on Linux
    Posts
    12,031

    Re: Need Help with IF/AND/OR Function

    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.

  3. #3
    Registered User
    Join Date
    03-17-2021
    Location
    Hyderabad
    MS-Off Ver
    2016
    Posts
    3

    Re: Need Help with IF/AND/OR Function

    Attaching Sample Sheet
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-17-2021
    Location
    Hyderabad
    MS-Off Ver
    2016
    Posts
    3

    Re: Need Help with IF/AND/OR Function

    Attached sheet

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2010/2019
    Posts
    12,082

    Re: Need Help with IF/AND/OR Function

    Based on the description in post #1 it would seem that the formula could be:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note that we haven't been told what should happen if P2 = J2.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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] A lookup function to return a persons function which will vary depending on dates
    By lloydalikes in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-25-2020, 08:31 AM
  2. Right function, Left function, Mid function to extract values in column A
    By bjnockle in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 06-14-2020, 03:14 PM
  3. COUNTUNIQUE Function in Google Sheets; Excel lacks a direct counterpart to this function?
    By PivotTablePSHomage in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-18-2018, 05:27 AM
  4. Calling function inside function. (aka nested function)
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-02-2015, 05:58 AM
  5. Replies: 13
    Last Post: 04-08-2014, 05:46 AM
  6. Replies: 1
    Last Post: 03-21-2012, 11:22 AM
  7. [SOLVED] Excel - User Defined Function Error: This function takes no argume
    By BruceInCalgary in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2006, 04:05 PM

Tags for this Thread

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