+ Reply to Thread
Results 1 to 3 of 3

Neting OR and AND in IF statement

  1. #1
    Registered User
    Join Date
    10-10-2016
    Location
    Coimbra, Portugal
    MS-Off Ver
    2016
    Posts
    86

    Neting OR and AND in IF statement

    Hi.

    I've got this formula:

    =IF(OR((B2+C2)=0; AND(B2="—"; C2="—")); ""; (B2+C2)/2)

    but it returns a #VALUE! error.
    I can´t quite figure out what the problem is.
    File attached.

    PR
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,199

    Re: Neting OR and AND in IF statement

    Try

    =IF(AND(B2="—",C2="—"),"",IF((B2+C2)=0,"",(B2+C2)/2))

    but why use "—" ?
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    10-10-2016
    Location
    Coimbra, Portugal
    MS-Off Ver
    2016
    Posts
    86

    Re: Neting OR and AND in IF statement

    A cell with a "—" and an empty cell have different meanings for what I want to do.
    That solves it.
    Thank you.

    PR

+ 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