I have an if function that compares two values.

=IF(INDIRECT(NextSheetName()&"!A1")&INDIRECT(NextSheetName()&"!B1") = CONCATENATE(A1,[B1]), [Yes], [No])

The first part:

INDIRECT(NextSheetName()&"!A1")&INDIRECT(NextSheetName()&"!B1")

runs flawlessly on its own but it does not work when contained within the IF statement. What am I doing wrong? Your help is greatly appreciated. Thank you.