+ Reply to Thread
Results 1 to 7 of 7

IF formula that looks at a range of cells

  1. #1
    Registered User
    Join Date
    07-26-2018
    Location
    West Mids, England
    MS-Off Ver
    2013
    Posts
    13

    IF formula that looks at a range of cells

    Hi,

    I'm trying to create a formula that will give me a true/false outcome based on looking at data within 2 columns. I have tried an IF AND formula, but this only seems to work if I am referencing the specific cell, but I actually want it to look at the whole column.

    As an example of what I'm trying to achieve: If Column A:A has an "X" anywhere down it, then reference column C:C and look for "Y" on that row then return true, if not return false.

    I tried =IF(AND(A:A="X",C:C="Y"),TRUE,FALSE) but this didn't work, but does if you specify the cell with the X, however the X will move manually each month so I want it too look at the whole column if possible.

    Can anyone help please?

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: IF formula that looks at a range of cells

    Try

    =COUNTIFS(A:A,"X",C:C,"Y")>0

  3. #3
    Registered User
    Join Date
    07-26-2018
    Location
    West Mids, England
    MS-Off Ver
    2013
    Posts
    13

    Re: IF formula that looks at a range of cells

    Thank you jason.b75, that works perfectly.

  4. #4
    Registered User
    Join Date
    07-26-2018
    Location
    West Mids, England
    MS-Off Ver
    2013
    Posts
    13

    Re: IF formula that looks at a range of cells

    Is there a way to also get this formula to work if one of multiple criteria are true?

    So taking the =COUNTIFS(A:A,"X",C:C,"Y")>0 but also come back true if C:C has either "Y" or "Z" for example?

    Thanks.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: IF formula that looks at a range of cells

    Try it like this:

    =SUM(COUNTIFS(A:A,"X",C:C,{"Y","Z"}))>0

    Hope this helps.

    Pete

  6. #6
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: IF formula that looks at a range of cells

    NVM, already answered.
    Last edited by jtakw; 07-29-2018 at 03:46 PM.

  7. #7
    Registered User
    Join Date
    07-26-2018
    Location
    West Mids, England
    MS-Off Ver
    2013
    Posts
    13

    Re: IF formula that looks at a range of cells

    Quote Originally Posted by Pete_UK View Post
    Try it like this:

    =SUM(COUNTIFS(A:A,"X",C:C,{"Y","Z"}))>0

    Hope this helps.

    Pete
    Thank you so much Pete. I was really close with getting this one right, but for some reason couldn't get it to work!

+ 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] Add IF Statement formula to cells in varying range and paste to used range
    By Webbers in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-26-2015, 01:28 PM
  2. [SOLVED] Return non-blank cells from range AND ignore cells with only formula w/o results
    By grafitti in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-06-2014, 08:15 AM
  3. Replies: 1
    Last Post: 09-04-2013, 07:23 AM
  4. [SOLVED] Formula Needed to count a range of cells based on criteria in 2 other cells
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-01-2013, 04:06 PM
  5. Replies: 1
    Last Post: 01-23-2013, 03:00 PM
  6. [SOLVED] VBA Copy a range of cells values using the range of cells in a formula (which will change)
    By murtaep in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 06-05-2012, 07:59 AM
  7. Replies: 2
    Last Post: 05-31-2012, 05:37 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