I have a list of contacts exported in an Excel. Now I want to adding the same activity to all of them
Welcome to SE Emma:
Make sure that you have contact Id in the exported list. You need this to match accurately to the contact. You then add columns to the spreadsheet for your information for the activities. You probably want to export a trial activity to see what you need and make sure you include all the mandatory fields. You can copy the information to all the contacts. Save as a CSV file. The go to Contacts &gt;&gt; Import Activities and follow the wizard.
I strongly recommend some testing, either on a test site of with some dummy contacts that you can delete afterwards. You will need a bit of trial and error to understand the detail. Set the source field to something specific so that you can identify these activities afterwards in case of any problem.
https://docs.civicrm.org/user/en/latest/common-workflows/importing-data-into-civicrm/#import-activities in the documentation will help.