+ Reply to Thread
Results 1 to 6 of 6

Is there a way to use IF and AND when searching a range of cells?

  1. #1
    Registered User
    Join Date
    05-01-2013
    Location
    Buffalo, NY
    MS-Off Ver
    Excel 365
    Posts
    26

    Is there a way to use IF and AND when searching a range of cells?

    Excel 2013 does not like the : (colon) between my range cells in this IF statement--
    IF(AND(G2='[Base.xlsx]Additional Customers Log'!G:G;K2='[Base.xlsx]Additional Customers Log'!$K$500);"Duplicate";"PendAssignment")

    Specifically, G2 holds a company name and K2 holds the company number. I want to compare today's workbook with yesterday's and show which are duplicates and which need to be assigned. I need a match on both the name and number.

    In the formula I left the semi-colon instead of a comma as breaks but I've tried it with both and have tried the range both with and without the $ to lock the range in place. I've also tried the generic G:G instead of line numbers but every time i try it, I get the 'we have detected a problem with your formula' pop-up and when I click "Okay', Excel takes me to the first colon between G:G, like it expects a break or another character.

    Has anyone done this successfully?

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Is there a way to use IF and AND when searching a range of cells?

    Hello GingerLeake,

    I do not have Excel 2013, but have you tried defining the Range for G? i.e., G2:G500. Change to suit.

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

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

    Re: Is there a way to use IF and AND when searching a range of cells?

    Think it's more to do with trying to compare a single cell to an entire column. You may be confusing this with COUNTIF, COUNTIFS, SUMIF, SUMIFS, etc.
    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


  4. #4
    Registered User
    Join Date
    05-01-2013
    Location
    Buffalo, NY
    MS-Off Ver
    Excel 365
    Posts
    26

    Re: Is there a way to use IF and AND when searching a range of cells?

    Trevor, you might be right. Someone on another forum gave me a countif formula that seems to be working fine. Thanks!

  5. #5
    Registered User
    Join Date
    05-01-2013
    Location
    Buffalo, NY
    MS-Off Ver
    Excel 365
    Posts
    26

    Re: Is there a way to use IF and AND when searching a range of cells?

    i think my post dropped but thank you for the suggestion, Winon. I'd tried with the numbers, both with and without the $ to look the numbers and letters in place. Nothing I tried worked but someone on another forum suggested a countif and that appears to be working.

    Thanks!

  6. #6
    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,428

    Re: Is there a way to use IF and AND when searching a range of cells?

    You're welcome.

    For future reference, please note ...
    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. Searching cells within a range that contain specific text
    By JohnG73 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-20-2016, 05:52 AM
  2. searching for partial text within a range of cells
    By td3201 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-13-2016, 07:26 PM
  3. Searching a range of cells for a value
    By JohnboyKGS in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-05-2015, 06:20 PM
  4. Set a range of cells for searching missing combinations
    By JOAO12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-20-2014, 10:06 AM
  5. Searching for text within a range of cells
    By JohnG73 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-12-2007, 09:33 PM
  6. Searching for Varying Text in a Range of Cells
    By Colin Vicary in forum Excel General
    Replies: 1
    Last Post: 05-15-2007, 07:01 AM
  7. searching for empty cells in a range
    By chris_mayer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2006, 07:23 AM

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