+ Reply to Thread
Results 1 to 9 of 9

IF AND Statement Not Working When Logical Test is Data Validation

  1. #1
    Registered User
    Join Date
    11-02-2019
    Location
    Orange Park, FL
    MS-Off Ver
    2016
    Posts
    3

    IF AND Statement Not Working When Logical Test is Data Validation

    Attached is my spreadsheet.

    I have a Data Validation List in the M Column that you can select what kind of tax the order is. I need my formula to look at the date and if it equals 9 then check to see if the list equals "Out_of_State". If both are true, I need it to SUM the Taxable Amount.

    I've tried =IF(AND(MONTH(Etsy!$A$2:$A$3000=9), Etsy!$M$2:$M$3000="Out_of_State"),SUM(Etsy!$J$4:$J$3000),0)

    But it just returns 0.

    Any ideas would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: IF AND Statement Not Working When Logical Test is Data Validation

    Perhaps =SUMPRODUCT((MONTH(A2:A17)=9)*(M2:M23=$M$2)*J2:J23)
    (adjust references as required)

  3. #3
    Registered User
    Join Date
    10-12-2019
    Location
    INDIA
    MS-Off Ver
    LATEST VERSION 1808
    Posts
    21

    Re: IF AND Statement Not Working When Logical Test is Data Validation

    Hi,

    Herewith attached your requisite formula. If any doubt let me know..

    Madhan
    India
    Attached Files Attached Files
    -
    Madhan Krishnan
    Coimbatore.
    India.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,432

    Re: IF AND Statement Not Working When Logical Test is Data Validation

    @Madhan

    Sorry for off-topic interjection:

    Although there is no official rule regarding this behaviour, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    11-02-2019
    Location
    Orange Park, FL
    MS-Off Ver
    2016
    Posts
    3

    Re: IF AND Statement Not Working When Logical Test is Data Validation

    Thanks for your response. Yes, could you explain your thinking?

    Your spreadsheet doesn't use a data validation list. The search for "Out_of_State" only works because it's in M2. I have three choices in my drop-down list and they could change.

  6. #6
    Registered User
    Join Date
    12-03-2012
    Location
    CHENNAI , INDIA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: IF AND Statement Not Working When Logical Test is Data Validation

    Hi ,

    Either of the following should give you the required result :

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Narayan

  7. #7
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: IF AND Statement Not Working When Logical Test is Data Validation

    Your layout is perfect for a Pivot Table. Is that an option you can work with?
    And actually you are using Filters, not Data Validation as far as I can see

  8. #8
    Registered User
    Join Date
    11-02-2019
    Location
    Orange Park, FL
    MS-Off Ver
    2016
    Posts
    3

    Re: IF AND Statement Not Working When Logical Test is Data Validation

    Thank you Narayan, the SUMPRODUCT worked great.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,432

    Re: IF AND Statement Not Working When Logical Test is Data Validation

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

+ 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 IF Statement as logical test, and output if false
    By wetbean in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-19-2018, 12:59 PM
  2. [SOLVED] If/then statement with variable in logical test and value fields
    By kahayler in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-15-2017, 01:02 PM
  3. If statement logical test range cells
    By rhudgins in forum Excel General
    Replies: 4
    Last Post: 12-07-2010, 04:51 PM
  4. logical test not working
    By arora in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-04-2008, 05:08 AM
  5. Second Logical test in if statement
    By speakers_86 in forum Excel General
    Replies: 3
    Last Post: 12-18-2007, 03:21 PM
  6. [SOLVED] If statement where the logical test is a range that equals a word
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 24
    Last Post: 09-06-2005, 12:05 PM
  7. [SOLVED] If statement where the logical test is a range that equals a word
    By Steve o in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10: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