# Countif when two different criteria in two different ranges

✭✭✭

I am trying to create a formula that will count the number of a specific date in a range AND when the hotel is a specific name.

=countif([Arrival Date.]1:[Departure Date.]800, "02/16/24" + ([Assigned Hotel]:[Assigned Hotel], "Marriott Water Steet")

I've tried contains, and, countifs. I'm at a loss.

• ✭✭✭✭✭
edited 01/26/24

Make sure that your date columns are set to actual Date columns.

```=countifs(
[Arrival Date.]:[Arrival Date.], Date(2024,02,16),
[Day 2]:[Day 2], date(2024,02,16),
[Day 3]:[Day 3], date(2024,02,16),
[Day 4]:[Day 4], date(2024,02,16),
[Day 5]:[Day 5], date(2024,02,16),
[Day 6]:[Day 6], date(2024,02,16),
[Departure Date.]:[Departure Date.], Date(2024,02,16),
[Assigned Hotel]:[Assigned Hotel], "Marriott Water Steet")
```

I cannot find a way to simplify this formula.

...

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!