+ Reply to Thread
Results 1 to 8 of 8

IF(AND(CountIf(...<> problem

  1. #1
    Registered User
    Join Date
    12-17-2012
    Location
    Athens
    MS-Off Ver
    Excel 2016
    Posts
    65

    IF(AND(CountIf(...<> problem

    Hi to all and thanks in advance for everyone who will try to help me on this problem.

    I am trying to find out if the values in A Column are < than the values in B and C Columns, but not equal with any of the other two as well. And if it is less and not equal then i am "calling" the price of A Column.
    I am using in D column the formula =IF(AND(COUNTIF(B1:C1;"<"&A1);A1<>C1);"";A1). It is working by bringing the min price of the three, but its is ignoring the not equal part as you can see in D2 (it is equal with at least one of the others).

    A B C D
    1 1,57 4,42 7,08 1,57
    2 1,65 4,50 1,65 1,65
    3 2,20 3,86 3,53 2,2
    4 9,61 4,00 7,25

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: IF(AND(CountIf(...<> problem

    ....but in ROW 2 neither B2 nor C2 are < A2 so the COUNTIF returns 0, hence the formula returns A2 rather than a blank.

    I don't really understand what you are trying to do, can you clarify?
    Audere est facere

  3. #3
    Registered User
    Join Date
    12-17-2012
    Location
    Athens
    MS-Off Ver
    Excel 2016
    Posts
    65

    Re: IF(AND(CountIf(...<> problem

    The column Letters are not good. Let me fix it.

    .........A........B.........C........D..
    1......1,57....4,42....7,08....1,57
    2......1,65....4,50....1,65....1,65
    3......2,20....3,86....3,53....2,2
    4......9,61....4,00....7,25....""

    So, i want in Column D the value of Column A if only the value of Column A is less than the value of Column B, less than the value of Column C and not equal with the Value in Column B and not equal with the value in Column C.

    So if value in A column is < than B and C and <> with B and C -----> = value of Column A. IF not then ""

    The D column is working the function.
    Last edited by komhs; 12-05-2017 at 06:09 PM.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: IF(AND(CountIf(...<> problem

    Try this version

    =IF(COUNTIF(B1:C1;">"&A1)=2;A1;"")

  5. #5
    Registered User
    Join Date
    12-17-2012
    Location
    Athens
    MS-Off Ver
    Excel 2016
    Posts
    65

    Re: IF(AND(CountIf(...<> problem

    Thanks you so much. It is working perfectly. Can you tell me the logic please if it is not a problem?

  6. #6
    Registered User
    Join Date
    12-17-2012
    Location
    Athens
    MS-Off Ver
    Excel 2016
    Posts
    65

    Re: IF(AND(CountIf(...<> problem

    Thanks you so much. It is working perfectly. Can you tell me the logic please if it is not a problem?

    And if i wanted to do something like that for the B column (to bring the value of B with A and C be < than B and <> with B), what i must put instead of B1:C1?

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: IF(AND(CountIf(...<> problem

    Quote Originally Posted by daddylonglegs View Post
    =IF(COUNTIF(B1:C1;">"&A1)=2;A1;"")
    COUNTIF is counting how many of B1 and C1 are > A1 - if that's 2 then they both must be larger (not equal)

    If you want to do the same comparison but on non-adjacent cells like comparing A1 and C1 to B1 then try like this

    =IF(AND(A1>B1;C1>B1);B1;"")
    Last edited by daddylonglegs; 12-05-2017 at 06:57 PM.

  8. #8
    Registered User
    Join Date
    12-17-2012
    Location
    Athens
    MS-Off Ver
    Excel 2016
    Posts
    65

    Re: IF(AND(CountIf(...<> problem

    Thank you so much

+ 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. CountIf problem
    By DPJW in forum Excel General
    Replies: 1
    Last Post: 12-13-2016, 06:33 PM
  2. [SOLVED] Countif problem
    By muish in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-21-2013, 07:51 AM
  3. Countif problem
    By w0rksh0p in forum Excel General
    Replies: 3
    Last Post: 11-12-2006, 10:52 AM
  4. countif problem.
    By psion in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 10-05-2005, 09:05 PM
  5. countif problem
    By SLKPM in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-29-2005, 04:05 PM
  6. CountIF problem
    By jjj in forum Excel General
    Replies: 2
    Last Post: 09-29-2005, 06:05 AM
  7. COUNTIF Problem
    By Eaglered in forum Excel General
    Replies: 1
    Last Post: 05-23-2005, 02:06 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