0

I have a sheet where I would like to calculate the total weight of an object after a number of operations have been performed on it, either adding or multiplying the weight. Any of the modifications could either be addition or multiplication and in any order. For example.

6+2x2=10

6x3+1=19

I managed to find an ineligant solution for 1 operation, which was to format multiples as text and then the following formula =IF(ISTEXT(B1)=TRUE,A1*B1,A1+B1) where A1 is the original number and B1 is the operation.

However, this does not scale up without doing ifs for all combinations.

I can get a cell to produce the formula I want as text with this formula ="="&A1&B1&C1 where I write either '+2 or '*2 depending on the operation, but I don't know if I can take this and then coerce that into a solved equation.

Any help with this would be massively appreciated, thank you.

EDIT: Below is a link to a mockup of what I am hoping to achieve. The "Combined Objects (ideal outcome)" table shows what I would like the table to do, which is enter in one of the objects and a number of modifications from the tables on the right is produce the solution to the equation.

in "Combined Objects" the Weight collums show how I can produce the equation I am hoping to solve, but I don't know how to get any further. I hope this makes it clearer.

https://docs.google.com/spreadsheets/d/1RybNokK8Gk3ofNm49bCJgRZDGWRnmooMYtgCZULPubg/edit?usp=sharing

4
  • Hi and welcome to WebApps. _ Any of the modifications could either be addition or multiplication and in any order._ You are going to need some kind of structure so that a formula can detect attributes than enable an accurate calculation. But your question doesn’t mean anything of this kind. Would you please edit your question to elaborate on your scenario so that we can understand the underlying process. Also, please explain the layout of your spreadsheet, and provide some sample data and examples of successful outcomes.
    – Tedinoz
    Jan 9 at 23:57
  • “6+2x4=10”. What am I missing here? Option#1: 6+2=8*4=32; Option#2: 2*4=8+6=14. It’s early here, but I can’t get a value of 10.
    – Tedinoz
    Jan 10 at 0:00
  • I have edited my response. I made a typo in the original equation, my apologies. I have edited my original question with a mockup of the idea of what I want to achieve. Jan 11 at 16:14
  • Your spreadsheet requires a permission request. Would you please change it so that it is accessible to anyone with the url.
    – Tedinoz
    Jan 12 at 4:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.