Assuming the revised question, and a table like the following:

```
name wages hrs worked cost at work
Bob 3 8 24 Y
Sally 4 0 0 N
```

The simplest way to get a conditional average is to use =AVERAGEIF,

```
=AVERAGEIF(E2:E3,"Y",D2:D3)
```

This formula will calculate the average of all the cells in `[cost]`

column, where the value in the `[at work]`

column is equal to "Y".

Back to your original question, the [at work] column can be calculated as

```
=IF(C2>0,"Y","N")
```

As an alternative (but not a very good one), you could simply use the IF statement to return either the cost or a blank, and then return the average of the column. In this case, the blanks aren't used in the average calculation (unlike a 0, which would be used). Here's the alternate formula:

```
=IF(C2>0,D2,"")
```

In which case the table would look like this (with an intentional blank for Sally at work):

```
name wages hrs worked cost at work
Bob 3 8 24 24
Sally 4 0 0
```