I think this is probably a bug report, but I'll just show what happens and let others decide. Mostly tested with Stata/SE 15.1 under windows but also tested a bit under Stata/MP 16.0 under Linux and seemed to behave similarly.

Code:
local a "week"
local b "year"

putexcel set test, sheet(foo, replace) replace 

// works OK if I leave off the first replace above
*putexcel set test, sheet(foo) replace 

// this works too
*putexcel set test, sheet(foo, replace) modify

putexcel a1 = ("`a'")   // only b1 shows up in excel
putexcel b1 = ("`b'")

*putexcel a1 = "foo"    // works OK if I use strings directly
*putexcel b1 = "bar"
In a nutshell, with the above code, only b1 has a value. I won't show all the variations I tried, but basically what seems to happen here is that if I try to output multiple cells with local macros, only the last one shows up in the spreadsheet itself.

Problem seems to happen only if:
* I use the replace option twice, for both the workbook and worksheet
* try to output multiple cells using local macros

This is not much of a problem for me going forward because upon further reflection I think the double replace specification here is probably redundant and it makes more sense to either:
* replace the workbook (which seems to imply replacing the sheet also?)
* modify the workbook and replace the worksheet

And both those ways seem to work fine. But this really confused me for a couple of hours as I sorted out what was causing the problem so I figured it was worth a post.