Task Summary |
Key Terminology |
What you will learn
You will learn how to use the functions countif() How you will be assessed Submit project when completed |
Function - A formula is an expression which calculates the value of a cell.
|
Setup your booking page
Activities
- Switch to the Sheet 2 tab at the bottom of the screen
- Rename Sheet 2 to Booking as shown below
- Each colour section in your stadium represents a different category of seat pricing. Within that category you need to decide if you will sell just one type of ticket, or multiple types - for example; adult and child. To achieve a Gold award, you will need more than one category
- Create tables like the one you see below to hold the booking information for each of your seating categories (colours). Two examples are shown, a basic one and a more advanced one with multiple categories. Area 1 in the example is the top blue section in the stadium, area 2 is the blue section at the bottom.
- Do not enter any data yet
Count seats booked and available
Activities
- Clicked in the empty available section. In the formula bar (shown in the image below)
- Enter the following function =countif( and then click on the stadium tab and highlight the area you wish to count by clicking and dragging
- Press comma ,
- Type two speech marks followed by a closing bracket like this - "")
- Press enter
- The final formula should look similar (but not the same) to the image below and the total seats should appear in the table
- Complete this for all of your available seat areas
How does this work?
Let's break down what we just did there. We are using a function to count the number of empty cells in an area on our spreadsheet.
The function we are using is called countif and this function requires two pieces of information - a range and a criteria.
Your range will be similar, but different to the example in the image above. The Stadium! part tells it which sheet to look at. The M4:AN8 are the cells the formula needs to search (start at M4 and finish at AN8).
The comma separates the pieces of information (parameters) we are passing to the function. After the comma we have two speech marks which means we are only looking for empty cells in that range.
So in structured English we are telling the spreadsheet:
Look on the Stadium sheet in the range M4 to AN8 and count the cells if they are empty.
The function we are using is called countif and this function requires two pieces of information - a range and a criteria.
Your range will be similar, but different to the example in the image above. The Stadium! part tells it which sheet to look at. The M4:AN8 are the cells the formula needs to search (start at M4 and finish at AN8).
The comma separates the pieces of information (parameters) we are passing to the function. After the comma we have two speech marks which means we are only looking for empty cells in that range.
So in structured English we are telling the spreadsheet:
Look on the Stadium sheet in the range M4 to AN8 and count the cells if they are empty.
Activities
Now you understand how this function works, can you complete the booked cells now? This time rather than searching for an empty "" string, you will need to search for a character that has been entered.
For example we could put an A in the cell when an adult books that seat, so the countif() function will need to search for "A"
For example we could put an A in the cell when an adult books that seat, so the countif() function will need to search for "A"