When you delete a local file, such as an Excel file, that is synced with OneDrive, it will indeed be deleted from your OneDrive cloud storage as well, because OneDrive automatically syncs your local files with the cloud. This happens because the syncing process mirrors your local file changes to OneDrive, so any deletions on your device are reflected in the cloud.
If you don't want this behavior, the best option would be to manually upload files to OneDrive instead of relying on the syncing feature. You can do this by using the "Upload Files" feature on OneDrive, which will allow you to add files to the cloud without them being synced automatically with your device. This way, you can store files in the cloud without having them directly linked to your local files.
You can have syncing enabled for some files and not for others by choosing which folders or files you want to sync to OneDrive. OneDrive allows you to selectively sync specific folders, so if you want to prevent photos and other files from syncing, you can turn off sync for those specific items. However, this requires some manual configuration to ensure only the desired content is synced.
Regarding the OneDrive app for Android, if you have photo backup turned on, the default behavior is that when you delete a photo from your phone, it is also deleted from OneDrive, as the sync action is designed to keep both locations in sync. However, there is an option to disable the sync between your phone's gallery and OneDrive, which would allow you to delete photos from your phone without them being removed from OneDrive. To prevent this, you could turn off automatic photo upload or selectively choose which photos to upload and keep in OneDrive.
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin