how to include external php file in drupal 8
I am not sure from your question which phpexcel library you are using, so there are potentially different answers, here is one:

1. On Packagist

If like in the case of mvlabs/mvlabs-phpexcel you would do the following:

on the command line:

composer require mvlabs/mvlabs-phpexcel


Then in the file where you are wanting to use it you can simply add a "Use" statement (as per this answer):

use ExternalPackage\namespace\Foo;


Drupal 8 does an auto-include and is "aware" of all the PHP libraries inside the vendor folder.