samedi 26 octobre 2019

Divide Large Number into Multiple Smaller Units

I am new to Stack overflow but I am having logic issues with Google sheets and need some advice on how to proceed.

My goal is I have 3 cup sizes, small medium and large. Example: Small holds 50ML, Medium 100ML,Large 200ML,etc

I want to take a large number and evenly distribute it among the cups to show me how many cups I will need with the least amount of cups used. Example : 170ML = 1 Large, 0 Medium, 0 Small. I only need 1 large to hold everything. Also, 240ML would suggest 1 Large, 0 medium, 1 small. Since small can hold the remaining 40 and medium would be too big of a container.

Problem is I don't understand how to break down my original large number into the smaller number as I have to check and compare if it will fit, I also have to be able to add more if there's a remainder and as far as I know the Google sheet functions only run and represent numbers once.

I've already tried breaking it down to my large container first then in my second row with medium cups I take the first result and subtract from my large number to see if anything is left. If there is, all I can do is add 1 or set the number, I can't seem to scale it up if it requires more than 1 cup which isn't what I want.

I've been going crazy trying to find an easy solution to this but it seems to get more complex as if I need IF statements of some kind.

If anyone has any ideas I'd be happy to hear them out.

Aucun commentaire:

Enregistrer un commentaire