Multi-Layered Searching in Excel

I have an excel spreadsheet with a list of states, elections in each state, politicians in any given senate/governor race, and the party affiliations of each of those politicians. I would like to create a bar denoting whether each race has a Libertarian competing in it. In my head, it looks something like this:

  1. Create range that includes all rows.
  2. Check current politician’s state. Narrow range to include only rows from that state.
  3. Check current politician’s race. Narrow range to include only rows from that race.
  4. Use COUNTIF to count the number of times “Libertarian Party” appears in the range.
  5. If number > 0, there is a Libertarian in a race. Return TRUE. Else return FALSE.

See here for example spreadsheet. SPREADSHEET.

  • Apache POI - Working with XSSFWorkbok + servlet response
  • Excel duplicate sheet fill with data.
  • VBA find empty cells between non-blanks & skip weekends when auto populate to calendar
  • How to do vlookup and fill down (like in Excel) in R?
  • OpenPyXL Using Built-In Conditional Formatting ie: Duplicate and Unique Values
  • How to read a nonlocal excel with PHPExcel
  • What is the actual code for this? What commands should I use?

    One Solution collect form web for “Multi-Layered Searching in Excel”

    You can use a COUNTIFS formula like:

    =IF(COUNTIFS(A:A,A2,B:B,B2,D:D,"Libertarian Party")>0,"TRUE","FALSE")
    
    MS Excel Spreadsheet is the best Office Software, Excel VBA and Excel Formulas make Spreadsheet work faster.