# Using Nested IF to calculate open items as of a reporting period

Options
edited 12/09/19

My Smartsheet tracks orders. I need to calculate the number of open orders as of a particular month. For example, how many open orders as of January or February and the amount is over 5k. Additionally I need to count orders that were closed after the reporting month. In other words, still open as of January even if closed in February.

Here is my logic:

If status is open then countif order received in the current month and year and is over 5K

and

If status is closed then countif order received prior to the current month or after the current month and over 5k.

I've created a nested IF formula which is not working.

=IF(Status:Status ="Open",COUNTIFS([Date Rec'd]:[Date Rec'd],<=varReportEnd1,[Claim Amount]:[Claim Amount],>=5000),IF(Status:Status="Closed",COUNTIFS([Date Rec'd]:[Date Rec'd],<=varReportEnd1,Amount:Amount,>=5000,[Closed Date]:[Closed Date]>varReportEnd1))

VarReportStart- 01/01/18

VarReportEnd=01/31/18

What's missing?