00:00Can you calculate average revenue based on whatever selection you made in column D's checkbox like this?
00:05Here's how you can do it.
00:07Let's start by introducing a couple of checkbox on this particular column D itself.
00:12You're going to select the cells on column D like this.
00:15Go to insert and then checkbox.
00:17That will introduce all the checkbox for you.
00:19Now to calculate the average, basically you're going to say equal average if open parenthesis.
00:27The first argument would be the range for the condition.
00:30This is going to be my range for the condition.
00:32And in this range, I'm looking for a true value, which means that the checkbox is check.
00:37And then the second or rather the third argument would be the range for the average calculation,
00:44which is going to be my revenue column.
00:46Close parenthesis and hit enter.
00:48But when you do that, you can see you get division by zero, mainly because none of my checkbox are
00:53selected.
00:53Now to mitigate that and make it a bit more hardy, what you can do is that you can encapsulate
00:59the average if with if error function like this.
01:03And if it's an error, the second argument for if error would be zero.
01:06As in, if there's an error, I'm going to show a value of zero instead of division by zero.
01:11When you hit enter, you can see it shows a value of zero because none of the checkbox has been
01:15selected.
01:16Now if you go ahead and select the checkbox, you can see that the average calculation is done for any
01:21of this row that has a checkbox next to it.