Explanation

The INDIRECT function tries to evaluate text as a valid reference.

The SHEET function then returns the current index for each sheet as listed.

SHEET will report the sheet number for a cell reference, named range, or Excel Table.

Excel formula: Get sheet name only

Excel formula: Worksheet name exists

Excel SHEET function