Forum Discussion

jacksaxby's avatar
jacksaxby
Copper Contributor
Aug 06, 2020

Calculate the width of square dynamically based on columns and rows

I've been trying to create a formula which determines the size (Weighting) dynamically of the square based on the rows and columns and haven't had any luck. Hope the images explain. Thanks!

11 Replies

  • mathetes's avatar
    mathetes
    Silver Contributor

    jacksaxby 

     

    Well, there is a saying that "a picture is worth a thousand words," but, sadly, it's not always true. At least not when it comes to creating Excel formulas.

     

    Better would be words that explain with an example or two what you expect the result to be for several of those sets of figures.

     

    There's also a bit of potential confusion (at least in my mind) around whether there's a distinction between size and weight. The way you write, "a formula which determines the size (Weighting)" seems to equate weight--or, to be more precise, weighting--with size.

     

    Some of the components in your image are not squares at all, but rather rectangles ("squares" per se being a subset of rectangles, of course)....

     

    So are you really looking for the size of squares, or the area of rectangles? or the sum of....?

     

    I trust you see the potential confusion here: these observations and questions are all asked in good faith. I'd really like to help, but, no, those images just raised more questions than the resolved.

    • jacksaxby's avatar
      jacksaxby
      Copper Contributor

      mathetes Hi Sorry for the confusion!

       

      Attached is better image I hope that explains things!

       

      The small squares will have a standard weighting of 1. and then the larger ones will have a value consisting of how many squares would fit in it. i.e the weighting 4 square could fit 4 smaller squares in.

       

      I've listed how each column and row is used. Based on these i think a weighting could be calculated using a formula. 

       

      I think it would work similar to: find the difference between the columns and if it is not 1 then the weight must be more than 1 but then the rows come in to determine how big it is?

       

      I hope that's clearer.

       

      Many thanks!

       

       

      • mathetes's avatar
        mathetes
        Silver Contributor

        jacksaxby 

         

        Sigh. I know it's clear to you. And I'm starting to see the pattern here. But, what's it all about?

         

        What I don't see is what you're trying to get to, first, with the calculations themselves.

        Then, in the bigger picture, what's the ultimate goal or objective?

         

        It might help too to know what the larger context is for even trying to do this in the first place. Are you in school, either as a student or teacher?  Is this an assignment having to do with

        • how many two dimensional rectangle/squares of varying dimensions can be fitted into a square of X dimensions OR
        • how large a square will be needed to contain (with no wasted space) the maximum number of objects defined as.....
        • OR something else altogether.

        Or are you an urban planner trying to figure out how many tables can be fit in a city square so the neighborhood restaurants can safely serve food to groups of varying sizes during the Covid-19 crisis?

Resources