# Formula help - Getting Unparseable!

Options
✭✭✭✭
edited 04/21/23

In my formula, I am taking data from three columns 1)if my Room Type field = King and it falls in between the 2) hotel check-in and 3) hotel check-out date to give me a 1. I need to know how many Queen Rooms I need on any given day.

Here is my formula:

=([# of King Rooms Needed]@row = "King") * IF(F(AND(DATE(2023, 7, 29) >= [Hotel Arrival Date]@row, DATE(2023, 7, 29) < [Hotel Departure Date]@row), 1, 0))

I have also tried this:

=COUNTIF({[Room Type]2 = "king"}, (AND(DATE(2023, 7, 29) >= [Hotel Arrival Date]@row, DATE(2023, 7, 29) < [Hotel Departure Date]@row), 1, 0))

• ✭✭✭✭✭✭
Options

Are you able to provide a screenshot for reference?

It seems like you might need something along the lines of:

=IF(AND([Room Type]@row = "King", [Hotel Arrival Date]@row<= DATE(2023, 7, 29), [Hotel Departure Date]@row>= DATE(2023, 7, 29)), 1)

• ✭✭✭✭✭✭
Options

Are you able to provide a screenshot for reference?

It seems like you might need something along the lines of:

=IF(AND([Room Type]@row = "King", [Hotel Arrival Date]@row<= DATE(2023, 7, 29), [Hotel Departure Date]@row>= DATE(2023, 7, 29)), 1)

• ✭✭✭✭
Options

Perfect that worked. Thank you so much.

• ✭✭✭✭✭✭
Options

Happy to help. 👍️

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!