+ Reply to Thread
Results 1 to 13 of 13

AND statement with adjacent cells

  1. #1
    Registered User
    Join Date
    10-27-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    88

    AND statement with adjacent cells

    In the example attached I am trying to create a statement that will return true with the following conditions: a cell in E:E contains the text “fault 1” and the figure in the cell to the right of that cell is greater than 6.

    So in the attached example cells E1 and F1 would trigger the statement as true as both these conditions are met but if I were to use the same formula for “fault 2” then it would be false as there are no adjacent cells containing a number over 6.

    Hope this makes some sense to anybody?
    Attached Files Attached Files

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: AND statement with adjacent cells

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


    If you are actually using Excel 2003 (as your profile indicates), try this regular formula:
    Please Login or Register  to view this content.
    copy either formula into B2

    Is that something you can work with?
    Last edited by Ron Coderre; 08-08-2013 at 07:30 AM.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    10-27-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: AND statement with adjacent cells

    I have updated to 2007 and have not updated my profile will do that now! Seems to be working perfectly thanks but would it be of any detriment to use:

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: AND statement with adjacent cells

    You can certainly reference entire columns if you need to. If you don't though, it's less work for Excel if you reference a range or a table.

  5. #5
    Registered User
    Join Date
    10-27-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: AND statement with adjacent cells

    Ok I may try and use a range then the workbook is starting to feel a little sluggish and I still have a lot left to add. Thanks for your help.

  6. #6
    Registered User
    Join Date
    10-27-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: AND statement with adjacent cells

    Sorry to reopen an old thread but I'm having a small issue with this formula, for some reason it will not function correctly when the numbers used are calculated by a formula. In the example attached the formula functions perfectly well when looking at the numbers in column whereas when looking at the numbers in column I, even though the number itself is identical. Can anybody shed any light? Hope I have explained this clearly enough, let me know if not and thanks in advance.
    Attached Files Attached Files
    Last edited by ormerods; 09-12-2013 at 10:09 AM. Reason: wrong attachment

  7. #7
    Registered User
    Join Date
    10-27-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: AND statement with adjacent cells

    Bump, anybody?

  8. #8
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: AND statement with adjacent cells

    I'm not understanding the issue. Except for the formula in E1 referencing Col_E instead of Col_D, the formulas are working as expected. What am I missing?

  9. #9
    Registered User
    Join Date
    10-27-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: AND statement with adjacent cells

    So sorry, I uploaded the wrong attachment! I had 2 files on my desktop with the same name but different extensions and I stupidly uploaded the wrong one!

    I have amended my post to include the correct example now.

  10. #10
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: AND statement with adjacent cells

    COUNTIF and COUNTIFS can get tripped up when interpreting/comparing numeric text and numbers.
    Try something like this regular formula (which coerces numeric text into numbers):
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Does that help?

  11. #11
    Registered User
    Join Date
    10-27-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: AND statement with adjacent cells

    Thanks once again, that seems to have done the trick.

  12. #12
    Registered User
    Join Date
    10-27-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: AND statement with adjacent cells

    Would anybody know if it is possible to manipulate this formula to actually count the number of instances that this is true?

    Currently it will show TRUE if there are any instances within the range where the criteria are met, is it possible to use this formula to count them?

  13. #13
    Registered User
    Join Date
    10-27-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: AND statement with adjacent cells

    Ok think I may have worked this out myself I just needed to remove the >0

+ 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. If statement for adjacent cell
    By kisboros in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-18-2013, 03:59 PM
  2. [SOLVED] Do Loop with If End If statement crashing- looping through column to copy adjacent cell
    By Auwal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2012, 02:33 PM
  3. Replies: 3
    Last Post: 07-30-2012, 11:20 AM
  4. IF Statement: Logic Between Adjacent Cells
    By fateshand in forum Excel General
    Replies: 9
    Last Post: 05-29-2009, 11:33 PM
  5. Adjacent cells in non-adjacent list?
    By anakeimai in forum Excel General
    Replies: 3
    Last Post: 09-10-2008, 05:49 PM

Tags for this Thread

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