Assuming there are many books:
- I would move the the books with the formats I want to merge from 'My Library' to 'Another Library' via the Copy to library (delete after Copy) tool.
- I'd then ensure my Add books->Actions settings were set to merge books (read the tooltips).
- Then I'd copy the books from 'Another Library' to 'My Library' using Copy to library tool
- Assuming all goes well I would remove 'Another Library' from calibre and hard delete it.
BR