+ Reply to Thread
Results 1 to 4 of 4

Countifs criteria less than another cell (rather than an entered value)

  1. #1
    Registered User
    Join Date
    01-13-2010
    Location
    Florida
    MS-Off Ver
    Office 2021
    Posts
    20

    Countifs criteria less than another cell (rather than an entered value)

    I am trying to get a count of something less than an amount I'd like to be able to vary. When I 'hard-number' the threshold, the formula works, like this: =COUNTIF(D25:M25,"<-200")

    However, I cannot get the formula to work when I use a cell reference [Cell L1] to specify the criteria. The following iterations all give the answer 0, even though one of the values in the row is -201:

    =COUNTIFS(D25:M25,"<L1")
    =COUNTIFS(D25:M25,"=<L1")
    =COUNTIFS(D25:M25,"=<L1")

    If I try to leave off the quotes:

    =COUNTIFS(D25:M25,<L1)
    =COUNTIFS(D25:M25,=<L1)
    =COUNTIFS(D25:M25,<=L1)

    I get the error message "There's a problem with this formula. Not trying to type a formula? When...."

    It would be far more elegant not to have to edit the cell each time I want to try to change the threshold. I'm sure there's a simple fix, and it is just the layers of rust from not using this formula, but I'd appreciate any assistance on this one.

    Jasman922

  2. #2
    Forum Contributor John Vergara's Avatar
    Join Date
    01-17-2022
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    209

    Re: Countifs criteria less than another cell (rather than an entered value)

    Hi @jasman922!

    You could try:
    PHP Code: 
    =COUNTIFS(D25:M25,"<" L1
    Blessings!

  3. #3
    Registered User
    Join Date
    01-13-2010
    Location
    Florida
    MS-Off Ver
    Office 2021
    Posts
    20

    Re: Countifs criteria less than another cell (rather than an entered value)

    John:

    Thanks! That seems to have worked! Any good explanation of why it needs to be in this format, because nothing from Excel tells me this is the preferred (or should I say necessary) format?

    Does it have to to with it being Office 365?

    jasman922

  4. #4
    Forum Contributor John Vergara's Avatar
    Join Date
    01-17-2022
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    209

    Re: Countifs criteria less than another cell (rather than an entered value)

    Hi again, @jasman922!

    The nature of the criteria argument in the COUNTIFS function is to be a string. By having a fixed part (such as the greater symbol) and a variable part (the cell where the condition is), it is simply concatenated to achieve the task in the correct way. If you put the direct reference as text, it will try to match that literal text, and not the value that is in the reference. Blessings!

+ 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] COUNTIFS help - count cell with criteria this and criteria this
    By rayted in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-20-2021, 04:25 AM
  2. [SOLVED] Countifs multiple criteria- criteria if cell is greater than another i adjacent column
    By Sircool1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-26-2018, 11:23 AM
  3. [SOLVED] Countifs cell has date within month AND other cell on row is eual to specific criteria
    By justinr in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 01-09-2015, 12:42 PM
  4. Replies: 1
    Last Post: 01-08-2015, 09:49 PM
  5. [SOLVED] CountIFS using criteria in one cell OR another - OR logic?
    By trubertiam in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-01-2014, 08:48 PM
  6. [SOLVED] COUNTIFS and multiple criteria per cell
    By jimbosi in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 12-04-2013, 06:37 PM
  7. Countifs to get criteria from a cell reference
    By SeanKosmann in forum Excel General
    Replies: 2
    Last Post: 01-27-2011, 11:00 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