+ Reply to Thread
Results 1 to 7 of 7

Formula is not working, What is wrong?

  1. #1
    Registered User
    Join Date
    01-03-2018
    Location
    Greece
    MS-Off Ver
    2016 365
    Posts
    12

    Formula is not working, What is wrong?

    Hello all, have a happy new year!!!
    I have created this formula:
    =IF(OR(AND(K9="A";P9<>"");AND(K9<>"A";P9="");AND(N9="A";P9<>"");AND(N9<>"A";P9=""));"✓";"X")

    Please note that in my country settings we use ";" insteaf of ","

    What I am trying to do is have a "✓" at a specifi cell, when the following is true:
    K9="A" AND P9 is not empty
    OR
    K9 is anything else than "A" AND P9 is empty
    OR
    N9="A" AND P9 is not empty
    OR
    N9 is anything else than "A" AND P9 is empty

    and when none of the above 4 rules is true, I want to get the "X" value.

    However, it seems there is a problem, because it's not working as I want.
    Do you find an obvious mistake I have made that I can not see? Somethin else?

    Thank you very much

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,732

    Re: Formula is not working, What is wrong?

    looks ok to me
    perhaps we need an example to see where its not working

    with no entry you will get a Tick
    as K9 does not = A and P is blank

    Do you want to test to see if K9 <> A - it is not blank ? as a blank is NOT an A and so if P is blank and K is blank - will return a TRUE
    same for other AND()

    Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet.

    A sample sheet would help here

    The forum does allow for spreadsheets to be uploaded direct to the forum -

    Please see the Yellow Banner at the top of the page explaining how to attach a sample spreadsheet

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.

    Here are the instructions, found at the top of the page again
    Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not thousands...) and some manually calculated results. For a new thread (1st post), scroll to Manage Attachments, otherwise scroll down to GO ADVANCED, click, and then scroll down to MANAGE ATTACHMENTS and click again. Now follow the instructions at the top of that screen.
    Last edited by etaf; 01-04-2023 at 01:41 PM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    01-03-2018
    Location
    Greece
    MS-Off Ver
    2016 365
    Posts
    12

    Re: Formula is not working, What is wrong?

    Ok, I think I found something. The cells K9, P9 an N9 are populated from a list, as validated data.
    This list contains an empty cell at the begining. So these 3 cells seem "null" since they take the first empty cell of the list, but they are not "null" according to excel.
    Is there a workaround for this problem?

    I don't think there is a need to post the spreadsheet at the moment, which by the way has some confidential data. If needed I will modify it and upload it.
    Thank you again.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,366

    Re: Formula is not working, What is wrong?

    If needed I will modify it and upload it.
    If it wasn’t needed, it wouldn’t be asked for. Without it, it is pretty much guesswork. Delete or replace the confidential data.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,732

    Re: Formula is not working, What is wrong?

    as stated need to see whats in the sheet -
    So these 3 cells seem "null" since they take the first empty cell of the list, but they are not "null" according to excel.
    we wont know what maybe in the list
    K9, P9 an N9
    when P9 is showing a null
    if you just use in a cell
    =P9=""
    do you get TRUE or FALSE
    same for
    =ISBLANK(P9)

    Also where the Data validation list - check the source list
    it maybe as simple as a space - which you can tell in the formula bar when in the list


    otherwise - you will need to show a sample here

    just a mock up with data validation list
    as you can see
    NULL or blank in K9 - is TRUE for Isblank(k9) and =K9=""

    so something else is going on in your file
    Attached Files Attached Files
    Last edited by etaf; 01-05-2023 at 03:44 AM.

  6. #6
    Registered User
    Join Date
    01-03-2018
    Location
    Greece
    MS-Off Ver
    2016 365
    Posts
    12

    Re: Formula is not working, What is wrong?

    Thank you guys, problem solved. Indeed the list contained some cells with spaces.
    Thank you again, etaf you are great!!!

  7. #7
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,732

    Re: Formula is not working, What is wrong?

    you are welcome
    Space may have been used to appear in the dropdown list , if still needed then , you could just add an OR()
    (AND(K9="A";OR(P9<>"",P9<>" "))

+ 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] Formula not working as expected - what am i doing wrong?
    By James.Fletcher in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-28-2022, 01:30 PM
  2. [SOLVED] What's wrong with my If And formula? it's not working
    By HelpHelpHelp in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-05-2022, 04:57 AM
  3. [SOLVED] VBA - Loop not working, where have I gone wrong???
    By Wadders in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-01-2020, 10:34 AM
  4. Vlookup not working, where am I going wrong?
    By forestavekids in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-08-2016, 07:02 PM
  5. [SOLVED] Formula stopped working - what's wrong ?
    By Lukael in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-12-2016, 01:13 PM
  6. [SOLVED] SUMPRODUCT Formula is not working and I cant see what is wrong with it
    By necht_angel in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-19-2013, 10:31 AM
  7. Replies: 7
    Last Post: 02-10-2009, 10:44 AM

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