Formulas and Functions

Formulas and Functions

Ask for help with your formula and find examples of how others use formulas and functions to solve a similar problem.

How to reverse the order in which a range is counted?

Hello,

I have the following Smartsheet:

In this Smartsheet, I'm building an asset booking system and, for the 'Asset Available During Your Booking Date Range?' column, it displays whether the particular asset is available for the date range inputted by the user.

My formula is as follows:

=IF(IF([Asset Booking Start Date:]@row = "", "", COUNTIFS([Asset ID:]:[Asset ID:], [Asset ID:]@row, [Asset Booking Start Date:]:[Asset Booking Start Date:], >=[Asset Booking Start Date:]@row, [Asset Booking End Date:]:[Asset Booking End Date:], <=[Asset Booking End Date:]@row) - 1) = 0, "AVAILABLE", "NOT AVAILABLE")

However, the problem is that my formula is counting... bottom up rather than top down if that makes sense? Essentially, in the screenshot I have above, the very first entry with the date range of 06/10/22 and 06/14/22 should state 'AVAILABLE' and the other cells below it, because their date ranges fall within the first entry's date range, should state 'NOT AVAILABLE'. But, for some reason my formula has reversed this and given the newest entry the status of 'AVAILABLE'.

Any help is much appreciated, thank you!

Best Answer

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!

Trending in Formulas and Functions