+ Reply to Thread
Results 1 to 4 of 4

Another =IF(OR(AND fx I need help with

  1. #1
    Registered User
    Join Date
    11-15-2012
    Location
    Tampa
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    63

    Another =IF(OR(AND fx I need help with

    Example:
    A, B, C
    1 3, 8
    2 -2, -8
    3 7, -7

    I am trying to write a function for a spreadsheet that calculates the following:
    If A1 is greater than 0 but less than 6 AND B1 is greater than or equal to 6, OR of A1 is less than zero AND B1 is less than zero, then in C1, I would want a "1" displayed, and if neither of the rules apply, I would like for C1 to be kept blank.

    So in the example above, both C1 and C2 should read "1", whereas C3 should be blank.

    Thanks in advance for your help!

  2. #2
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Another =IF(OR(AND fx I need help with

    try
    =If(Or(AND(A1>0,A1<6,B1>=6),AND(A1<0,B1<0)),1,"")

    hope this helps

    -Edit-
    Also..according to the rules in your post, c1 and c2 would be blank, while c3 would = 1...to change to your output, swap 1 and "" around..
    Last edited by dredwolf; 11-22-2012 at 02:11 AM.
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  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,939

    Re: Another =IF(OR(AND fx I need help with

    im not sure what you want to do with the values already in col C in you're example above, but try this...

    =IF(AND(A1>0,A1<6,B1>=6,OR(AND(A1>0,B1>0))),"",1)
    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
    Registered User
    Join Date
    11-15-2012
    Location
    Tampa
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    63

    Re: Another =IF(OR(AND fx I need help with

    GOT IT! Works like a charm! Thank you!

+ 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