I think you are making this harder than this needs to be from a reasoning standpoint. Given a budget M, you are trying to maximize your total expenditure. You have just one input cost, being marginal material cost of the additional good. There is no trade-off between inputs, so "maximizing" in this sense just means how much you can buy given M, which will end up being simple algebra rather than some more difficult Lagrange calculus needed for multivariate constraint functions.
The issue with your LINEST model is that either your dependent variable is the marginal cost, not the total cost (as needed for your objective), or you are interpreting it incorrectly. If the former, rerun the regression with the data you referenced. If you used the two columns of data that you referenced then your interpretation I wrong and should be as follows: your coefficient β(1) would then just be the estimated price per item (an intercept shouldn't exist as no fixed costs are present), with the independent variable being the number of units, and the dependent being the total cost for that day. If you use this model, then your given M should be plugged into the left side of the equation and then solve for the number of units algebraically. Keep in mind that if you end up with, say, x=12.7, then you should round down, as 13 units would be unattainable under the constraint.
I would consider using the log function, however, due to the increasing MC like you mentioned above. For your log function, follow the same algebra as above, solving for x=units attainable under the y=M constraint. Use a calculator for that one, no one wants to do log base 1.77 of a number in their head.