Episode: 1515 Title: HPR1515: 29 - LibreOffice Calc - Models and "What-If" Analysis Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr1515/hpr1515.mp3 Transcribed: 2025-10-18 04:33:01 --- ... ..." ... Hello, this is Ahuka, welcoming you to Hacker Public Radio for another exciting episode in our ongoing series of Libra Office, focusing on Libra Office Calc, the Spreadsheet program. The next topic is extremely important because it addresses where most beginning users of Spreadsheets get into trouble. First, understand that building models and doing what-if analysis is fundamental to the success and widespread adoption of Spreadsheets all over the world. Now, a model can be thought of as a mathematical representation of a process of some kind. It could be financial, such as projecting my sales over the next year, or perhaps working out when my car loan will be paid off, or it could be scientific, such as projecting out the reaction times and quantities in a chemical reaction. The only real requirement is that whatever you are modeling has to be something that can be represented using mathematical formulas of some kind. What if analysis takes this model and lets you experiment to see how changes in different variables affect the results in your model? If I am figuring out when my car loan will be paid off, I might ask how paying an extra $20 a month against the principal would affect my results. Presumably, it should lead to getting it paid off sooner, at least if I set up the model correctly. Or in the case of a chemical process, how would different temperatures or pressures affect the reaction times and quantities? By experimenting with different values in my model, I can do this comparison easily, but only if I built the model properly in the first place. And the key here is to understand when to use numbers and when to use cell addresses and formulas. And almost always the answer is to use cell addresses and formulas. When I was teaching corporate finance to college students, I assigned them a project of creating a business plan for a hypothetical business. I didn't particularly care about what the business was, I was really trying to teach them proper technique. So if their business involved selling snow to Eskimos, I didn't care, but they had to build a business plan in a spreadsheet and they had to do what if analysis as part of this project. Now the first rule is that the only place I would let them enter raw numbers was in a special designated area called assumptions. Though if you wanted to name it constants or parameters, that's not a big deal, the point is that this is where you would place these variables starting numbers or whatever. For my corporate finance students doing a business plan, this would be where they would place the price of the product, the cost per unit of producing it, the interest rate at which they could finance operations, etc. You can imagine the sort of financial variables you'd want to incorporate in the model of this kind. I would usually have them place this to the side of the main model where you could see it, but out of the way of the main rows and columns of the spreadsheet. Then they were to use these numbers by creating a cell address that pointed to the particular number in the assumptions area. So if the price of the product was in cell I4, for example, they could use that anywhere in the model simply by referencing this address. If they wanted it to appear in a calculation, they would use for example something like equals a1 multiply I4. Now this is good as far as it goes, but suppose you then wanted to do a fill like we talked about last time. You might want to be looking at sales month by month and working out revenue by multiplying that the quantity sold against the price that you can sell the product at. You would want to set up the calculation the first time and then do a fill to go through the remaining months. And in a case like that you do not want the address for the price of the product to change since this is a constant in the calculations. So you would do something like equals a1 multiply dollar sign I dollar sign 4. Now no matter whether you are filling down a column or a cross a row the cell for the product price will not change. But suppose you wanted to allow for inflation. Let's say we assume that prices will rise by 0.25% each month and we are doing a business plan with 12 months in it. Well you might think you could just plug in a multiplier. Suppose you had a number for each month so the first month of the fiscal year was one, the second month was two and so on. And let's say that these numbers appear in row two with a spreadsheet and there are 12 columns for 12 months. Just adjust the formula. Something like this a1 star open parent a2 star 0.25 star dollar sign I dollar sign 4 close parent. Now this would in fact work but if you were my student you just lost credit. Remember every single one of your assumptions or parameters must go in the assumptions area and the rate at which prices rise each month is an assumption. It should go there. So now let's go back to the spreadsheet and put an entry in the assumptions area of 0.25 and let's say for example that this winds up in cell I7. Now I can rewrite the formula correctly as equals a1 star open parent a2 star dollar sign I dollar sign 7 star dollar sign I dollar sign 4 close parent. Now I think it's it's probably clear what I say star I mean multiply but we're going to be doing talking about this a lot so it's the asterisk which is the multiplication symbol. So now I've got a formula made up of entirely of cell addresses and mathematical operators so things are good. Now when I was teaching I explained all of this and told my students that anytime I saw a raw number outside of the assumptions area they would lose credit and I would literally click on every cell looking for this mistake. Theoretically a student could wind up with a negative number for a grade on this project but I'm not as heartless as this may sound. I also had the policy that at any time during the semester I would on request review what they had done so far and give them feedback on whether they were on the right track. After all in the world of business you are usually expected to check if you're on the right track if the boss gives you an assignment and not taking the time to check marks you as a fool. So in fact I was trying to teach multiple lessons in the same course. Now what if analysis this is the other part of this powerful technique and you can't do it properly if you don't get the model building part right. Now the idea is to have multiple copies of the model but change one or more parameters each time and this is not hard at all. The way to do this is to build the initial model on the first sheet of your spreadsheet which is the one that on the bottom has a tab saying sheet one. If you built it following the principles I outlined above you can now do the magic. You can copy the entire sheet and it is easy. Just hold down the control key or if you're on a Mac the option key. Click on the tab that I will assume says sheet one. Drag it to the right. Release the mouse button and you will have a copy that is named sheet one underscore two. In other words the second copy of sheet one. Now with the copy you can now do the first what if analysis. For instance suppose inflation is higher than 0.25% a month. Well just go to sell i7 in your copy and change it to what you think is a better alternative such as for example 0.35% per month. The original model on sheet one is still there untouched but on this copy as soon as you change cell i7 the entire spreadsheet recalculates to incorporate this new number. And this is as good a place as any dimension that you don't need to leave your sheets with names like sheet one, sheet one underscore two or whatever. Just right click on the tab and in the menu that comes up you can rename the sheet. I would give it something descriptive based on what you do with your copy. For instance you might name sheet one something like base model then if you go to your copy you can call it the high inflation version and so on. The point is that you can explore as many different scenarios as you can think of and see just how big a difference it makes to the end result. Maybe your business plan is very sensitive to changes in the finance rate of borrowing but less sensitive to changes in the cost of production. That might be very valuable information to have and by doing what if analysis you can bring that out. But it should also be clear by now that if you are not totally rigorous in building your model. If you let some parameters slip into the body of the model instead of being in a separate assumptions area you would be seriously hampered in doing this analysis. This is probably the single most important principle in spreadsheet use that you need to understand. And we're going to illustrate it. Our next tutorial we're going to build a simple model of savings over time and use it to do some what if analysis. So this is Ahuka for Hacker Public Radio. Signing off and reminding you as always to support free software. Bye. You have been listening to Hacker Public Radio where Hacker Public Radio does our We are a community podcast network that releases shows every weekday Monday through Friday. Today's show, like all our shows, was contributed by a HBR listener like yourself. If you ever consider recording a podcast then visit our website to find out how easy it really is. Hacker Public Radio was founded by the digital dog pound and the economical and computer globe. HBR is funded by the binary revolution at binref.com. All binref projects are proudly sponsored by Lina Pages. From shared hosting to custom private clouds, go to LinaPages.com for all your hosting needs. Unless otherwise stasis, today's show is released under a creative commons, attribution, share a like, lead us our lives.