+ Reply to Thread
Results 1 to 14 of 14

how to check the adjacent cell of the COUNTIF result in a formula

  1. #1
    Registered User
    Join Date
    01-13-2017
    Location
    Greece
    MS-Off Ver
    2007
    Posts
    52

    how to check the adjacent cell of the COUNTIF result in a formula

    Hello everyone

    Can someone please help me with this puzzle ? I have this formula to check out in a column if there is a match :

    =IF(AND(COUNTIF(CharacterSheet!B1:B20;"Acrobatics: Agile")=1;COUNTIF(CharacterSheet!B1:B20;"Acrobatics: Message Runner")<=2);"Acrobatics: Message Runner";"")

    In this formula basically the first half is working properly (IF in CharacterSheet tab B1:B20 there is one entry "Acrobatics: Agile"), the problem now is in the second part which should check again in range B1:B20 if there is an entry "Acrobatics: Message Runner" but this time it should check if the adjacent cell to the Left (checking B1:B20 for Acrobatics: Message Runner and then check the cell A? next to it) if the value is equal or below the number 2.

    As it is now, my formula in the second part is checking for double entry of Acrobatics: Message Runner in the range B1:B20 but that shoud never be the case since the Columns A:B in CharacterSheet tab are like this :

    Please Login or Register  to view this content.
    Thank you guys

  2. #2
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,933

    Re: how to check the adjacent cell of the COUNTIF result in a formula

    You'll probably need this:

    COUNTIFS(CharacterSheet!B1:B20;"Acrobatics: Message Runner";CharacterSheet!A1:A20;<=2)
    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.

  3. #3
    Registered User
    Join Date
    01-13-2017
    Location
    Greece
    MS-Off Ver
    2007
    Posts
    52

    Re: how to check the adjacent cell of the COUNTIF result in a formula

    Hello AliGW

    Will this check for the adjacent cell of Acrobatics: Message Runner though ? I mean some values in Column A will be 1 some others will be 2 and some others might even be 5. We need the formula to check Column B for Acrobatics: Message Runner and the adjacent value (if it finds it) to check if it is 2 or less.


    Edit : This addition gives me a formula error .

    =IF(AND(COUNTIF(CharacterSheet!B1:B20;"Acrobatics: Agile")=1;COUNTIFS(CharacterSheet!B1:B20;"Acrobatics: Message Runner";CharacterSheet!A1:A20;<=2);"Acrobatics: Message Runner";"")

    Thank you
    Last edited by ulothar; 08-30-2017 at 03:50 AM.

  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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,933

    Re: how to check the adjacent cell of the COUNTIF result in a formula

    Try it and see!

    =IF(AND(COUNTIF(CharacterSheet!B1:B20;"Acrobatics: Agile")=1;COUNTIFS(CharacterSheet!B1:B20;"Acrobatics: Message Runner";CharacterSheet!A1:A20;<=2) ;"Acrobatics: Message Runner";"")

  5. #5
    Registered User
    Join Date
    01-13-2017
    Location
    Greece
    MS-Off Ver
    2007
    Posts
    52

    Re: how to check the adjacent cell of the COUNTIF result in a formula

    This is the error I get
    Attached Images Attached Images

  6. #6
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,933

    Re: how to check the adjacent cell of the COUNTIF result in a formula

    Which version of Excel are you using? I can't see the image properly - it's fuzzy. Attach the workbook here.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

  7. #7
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,933

    Re: how to check the adjacent cell of the COUNTIF result in a formula

    Maybe try this:

    =IF(AND(COUNTIF(CharacterSheet!B1:B20;"Acrobatics: Agile")=1;COUNTIFS(CharacterSheet!B1:B20;"Acrobatics: Message Runner";CharacterSheet!A1:A20;<=2));"Acrobatics: Message Runner";"")

  8. #8
    Registered User
    Join Date
    01-13-2017
    Location
    Greece
    MS-Off Ver
    2007
    Posts
    52

    Re: how to check the adjacent cell of the COUNTIF result in a formula

    Sure but the project is protected. I will send you the password to unlock the Visual Basic (and from there to remove the scroll area limitation from the tab StartingPage1)

    Thank you
    Attached Files Attached Files

  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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,933

    Re: how to check the adjacent cell of the COUNTIF result in a formula

    No, sorry - you are making me have to jump through hoops now to help you. Please provide a cut-down, simplified version with just the worksheet in question for me to troubleshoot. I am not going to try to find my way around the workbook you have attached.

  10. #10
    Registered User
    Join Date
    01-13-2017
    Location
    Greece
    MS-Off Ver
    2007
    Posts
    52

    Re: how to check the adjacent cell of the COUNTIF result in a formula

    ok give me a second to make a sample file then will take not much time.

  11. #11
    Registered User
    Join Date
    01-13-2017
    Location
    Greece
    MS-Off Ver
    2007
    Posts
    52

    Re: how to check the adjacent cell of the COUNTIF result in a formula

    Ok here we go
    Attached Files Attached Files

  12. #12
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,933

    Re: how to check the adjacent cell of the COUNTIF result in a formula

    Try this:

    =IF(AND(COUNTIF(CharacterSheet!B1:B20;"Acrobatics: Agile")=1;COUNTIFS(CharacterSheet!B1:B20;"Acrobatics: Message Runner";CharacterSheet!A1:A20;"<="&2));"Acrobatics: Message Runner";"")
    Last edited by AliGW; 08-30-2017 at 04:30 AM.

  13. #13
    Registered User
    Join Date
    01-13-2017
    Location
    Greece
    MS-Off Ver
    2007
    Posts
    52

    Re: how to check the adjacent cell of the COUNTIF result in a formula

    Again same error in the formula :/ maybe in "Acrobatics: Agile")= should be 1 next

    Edit : Yeah now it works needed the 1 after = thanks alot
    Last edited by ulothar; 08-30-2017 at 04:29 AM.

  14. #14
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,933

    Re: how to check the adjacent cell of the COUNTIF result in a formula

    Glad to have helped!

    Please mark the thread as SOLVED using the thread tools top right.
    Attached Files Attached Files

+ 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. Formula that returns adjacent cell depending of result of diferent cells
    By Flip_Flop in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 07-27-2017, 08:50 AM
  2. [SOLVED] If the IF function result is false then check the next cell until get a true result
    By Beag air Bheag in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-10-2017, 08:55 AM
  3. [SOLVED] Formula that will result the cell blank based on adjacent cell
    By LShepherd in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-20-2016, 01:04 PM
  4. Replies: 5
    Last Post: 09-01-2014, 11:20 AM
  5. [SOLVED] Enter formula result from one cell into a COUNTIF formula in another cell. Help please!
    By gregrach in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-10-2014, 11:23 AM
  6. Replies: 8
    Last Post: 08-02-2013, 05:13 AM
  7. Need formula to check adjacent cell value, and report.
    By theRDstore in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-05-2009, 01:52 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