The Student Room Group

help with simple spreadsheet formula

Can someone tell me how to do the following in a spreadsheet?

I have to do this in a spreadsheet. "We always measure the longest length in the room , the longest width and the perimeter in metres. We have carpets in 4m wide rolls , 6m wide rolls and 8m wide rolls. If the longest width of the room is less than or equal to 4 m wide then we quote for a 4m wide roll . if it is greater 4m and less than or equal to 6m wide then then we quote for a 6m wide roll. Otherwise we quote for an 8m wide roll. "


We not not cater for rooms wider than 8m as that requres a specialist carpet fitte. We then calculate the area of the carpter required which is the width of the roll times the longest length. This will always be in square metres.
Reply 1
Try the IF function.

You might say, =IF(W=<4, 4, IF (W=<6, 6, IF(W=<8, 8, if W>8, false)

Where W denotes the width of the room and the "=<" part of that means less than or equal to.

What that does is first look and see if the width is less than or equal to 4, and if it is, it returns 4 (ie the carpet you'll use). If it isn't less than or equal to 4, it moves onto the next If statement - which does the same thing but for 6 m, and then for 8 m. And then the last part returns the value FALSE if with width is more than 8 m. In the next cell along, you could have

= IF(X = false, W*L, "")

In this case, X denotes the cell to the left and it tests to see if the value of that cell is false (the case when W>8). If the value is false then it calculates the area (W*L) and if not, it just returns a blank space.

Obviously where i've used letters you'll use cell references, and if you get stuck, just type the function =IF in a cell and press F1 to get more help.

Latest

Trending

Trending