Forum Discussion
Calculate the width of square dynamically based on columns and rows
I'm sorry I'm so dense. We're clearly speaking past each other. I asked a short while ago for a worked out example. Here's the way I put it at the time, and the key there is "words that explain...what you expect the result to be"
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.
You keep sending more images, which do nothing for me. (I'm a more verbal, text-driven animal, I guess). To the point that I don't even understand (apparently) what you mean by "get the size of each box" if it's not just 1x1=1; 3x1=3; 5x1=5
If that's all it is, if you're really just asking how to do simple multiplication in Excel, then, in Column C, row 2, enter =A2*B2 and copy that formula and paste it in rows 3 through to the bottom row.
If, on the other hand, you're looking for something else, what is that "something else"? It might be just as simple as spelling out what the "weighting" is that you're currently entering manually. And where do you get it from? How does it differ from size, or is it the same thing. As I said earlier, you seem to be using size and weighting almost interchangeably.
If you have a spreadsheet going here, it actually would be helpful to post it rather than images. It would give me (or somebody else) a glimpse into what you're working with and what you've tried.
I apologize for being so dense. As I said, we seem to be speaking past each other, each of us thinking we're being clear.
mathetes Hi
Yeah I have been using size/weighting interchangeably. So as you can see from the slots image. In the context the bigger games have a higher size value. The smaller squares have a base value of 1, these values have been input manually so far. We need to calculate the size value of each square using the columns and rows. There is 6 columns in this example so 6, 1 sized squares could fit on 1 row. a square than spans multiple columns is counted as 1 column but a larger weighting is assigned.
Attached another image, ive split it further. Thanks for the help!
I want to get the size of each. You can see that the 1st game starts on the 1st row at column 1, then the second game starts at column 3. this means that the size of game 1 will have a size of 2. However if the game spans 2 rows then this size will be 4. Thanks Again!
- mathetesAug 06, 2020Silver Contributor
Wait a minute here. Are you going FROM the images TO the numbers? TO the calculation?! Not the other way around?
Your raw material is the image? It wasn't a way to illustrate what you were tying to accomplish with the formulas, but a way to get to the numbers?
No wonder we weren't speaking the same language. I was totally reading all of this as CREATING the squares and rectangles from the numbers in Excel's various columns.
I have no idea how to take a set of images (or one image with multiple rectangles and squares) and convert that into the row and column data you're asking for, thence to predict that weighting. Sorry. The other way around, yes, maybe we could talk.
If those images are discrete images, then it might be possible to extract pixel counts of length and width and start doing some things with that data, but that aside, I am afraid I don't know what you could do other than enter the numbers you've been entering, with whatever the heuristic is that you've developed to develop those numbers consistently. You need quantitative data of some kind to begin with; pure images, without some way to measure them via the computer...would not work. If you could take that image and get pixel counts for the horizontal and vertical axes, maybe that could serve as a starting point, but you'd still have to enter (Manually) how many images there are in each horizontal and vertical section....
Maybe there's somebody else out there, another expert in Excel, who knows a bit more about image manipulation, who can help. I like to think that at least I helped us get to the bottom of the confusion.
Best wishes.
- jacksaxbyAug 06, 2020Copper Contributor
mathetes Hi, I manually input the correct row and column the images are on. its just using a formula on the rows and columns to get the size of it.
For instance. =IF((A3-A2)>1,A3-A2,1) gets me the correct columns but does not account for the size of the games that span multiple rows
- mathetesAug 07, 2020Silver Contributor
Since nobody else has chimed in (yet), I'll give it another try. I still need to give you a more clear explanation to someone who's not inside your head. You know what you're saying, what you're doing. It's still not clear to me.
I've asked before, and I'll ask once more:
Walk me through how you'd do those calculations that you want if you were NOT trying to write it in Excel. That's what I meant in one of my earlier messages when I asked you to walk through a complete example for (I said then several rows because I was going the other direction) ..
So now, I'm asking that you walk through .for several images and spell out what you're doing to get the numbers you are looking for. Don't talk about rows and columns; talk about numbers and where you get them from, what you do with them, how you get the size/weight from those.
Maybe another way to say it: if you were back in school working this out on a blackboard (or whiteboard), how would you do it and explain it to the others in the class?