No, the time interval you specified (7 days back) will also include the ESXi that are currently in maintenance mode.
The CPU and memory metrics for a cluster are aggregated metrics, in other words these metrics are calculated through the aggregation jobs that run on the DB server that hosts the vCenter DB. These metrics are not directly obtained from the ESXi nodes in the cluster.
To exclude ESXi hosts that are in maintenance, you will have to do the aggregation yourself I'm afraid.
Get all the ESXi hosts in the cluster, excluding the ones in maintenance, and calculate the average of the metrics that are returned.