+ Reply to Thread
Results 1 to 5 of 5

IF+AND function doesn't work

  1. #1
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Question IF+AND function doesn't work

    Hi All,

    As you can see in my example I have used IF+AND function in Column C, but it doesn't work.

    Any idea where I'm wrong?

    Thank you in advance!
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,747

    Re: IF+AND function doesn't work

    It would help if you explained what you want this formula to do.

    This expression

    AND(B2="NBD",D2="Monday",D2="Tuesday",D2="Wednesday",D2="Thursday")

    will always be FALSE because D2 can only have only value; it cannot have Monday AND Tuesday AND Wednesday, etc.

    Could it be--and I am just guessing here--that you mean

    AND(B2="NBD",OR(D2="Monday",D2="Tuesday",D2="Wednesday",D2="Thursday"))

    That is, B2 is NBD and D2 is any of those days?

    Same problem with your other AND expressions.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    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,352

    Re: IF+AND function doesn't work

    Try ...

    =IF(AND(B2="NBD",OR(D2="Monday",D2="Tuesday",D2="Wednesday",D2="Thursday")),A2+1,IF(AND(B2="NBD",OR(D2="Friday",D2="Saturday")),A2+3,IF(AND(B2="NBD",D2="Sunday"),A2+2,"")))


    You need OR test for D2: it cannot be MODAY AND Tuesday - it is Monday OR Tuesday OR ..... etc.

  4. #4
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: IF+AND function doesn't work

    Hi

    =AND(D2="Monday";D2="Tuesday") never occurs, =OR(D2="Monday";D2="Tuesday") maybe.

    Regards

  5. #5
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: IF+AND function doesn't work

    Thank you John!
    Working as I wish!

+ 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] Help with INDIRECT FUNCTION Doesn't work
    By Kinez101 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-07-2013, 11:12 AM
  2. Why doesn't this array function work?
    By OldManExcellor in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-24-2013, 10:03 AM
  3. Simple AND function - why doesn't it work?
    By rojo1221 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-16-2013, 12:41 AM
  4. Custom VBA function doesn't work
    By MCCCLXXXV in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2008, 04:54 PM
  5. [SOLVED] NETWORKDAYS Function doesn't work
    By Dean in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-23-2006, 10:55 AM
  6. NZ function doesn't work!
    By salut in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-23-2006, 03:50 PM
  7. [SOLVED] Why doesn't my =RANDBETWEEN function work?
    By DanielWalters6 in forum Excel General
    Replies: 4
    Last Post: 12-19-2005, 06:35 AM
  8. [SOLVED] tried using SUBTOTAL function (XL XP) and it doesn't seem to work
    By JethroUK© in forum Excel - New Users/Basics
    Replies: 12
    Last Post: 08-22-2005, 03:05 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