Locking takes two steps: cells are locked by default, but it only takes effect once you protect the sheet. So unlock the editable cells first.
Do it with AI insteadUnlock editable cells
Select the cells users may edit ▸ Format Cells ▸ Protection ▸ uncheck Locked.
Protect the sheet
Review ▸ Protect Sheet, set a password if you want.
Test it
Try editing a locked cell — Excel will block it.
Cells are locked by default — you must unlock the editable ones before protecting the sheet.