简体   繁体   中英

Excel formula to get number of rows that fulfill 2 criteria

I have an excel list with around 5000 entries and 15 columns.

The goal is to display in one cell the result of the following query:

=(Number of rows where ColumnB Like "*123*" and ColumnC like "*House*")

It seems that normal VLOOKUP will not help because it only displays the first result. On the other hand formulas with COUNTIF etc. do not work because either it is not possible to use wildcards (*) or it is not possible to enter more than one search criteria.

Unfortunately it is a shared excel list, so I cannot use VBA.

Do you have any suggestions how I can implement it by the use of formulas?

  1. If column B contains text :

     =COUNTIFS(B:B,"*123*",C:C,"*House*")
  2. If column B contains numbers (which wildcards will not work with):

     =SUMPRODUCT(ISNUMBER(SEARCH(123,B2:B4))*ISNUMBER(SEARCH("House",C2:C4)))

    changing the range references as needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM