# Percentage Calculation from last 5 entries

#### ExcelRoy

##### Well-known Member
Hi,

I am looking to calculate an efficiency percentage from the last 5 jobs worked

ie

150%
100%
-
-
150%

I am currently using the following formula

=IF(F16="","",SUM(J23:J27)/5)

But this assumes there is 5 entries, but as you can see from the example there is only 3 entries from the 5 available thus giving a false reading

Can I modify my formula to suit the available entries?

Many thanks

### Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

#### AnalystJames

##### New Member
Does this work?

=SUMIF(J23:J27,"<>0")/5

#### ExcelRoy

##### Well-known Member
Hi AnalystJames,

No sorry this doesn't produce the desired result

It seems to devide by 20% each calculation

ie if there are 2 entries it return 40% etc

many thanks

#### AnalystJames

##### New Member
Oh I see, does this work?

=SUM(A1:A5)/COUNTIF(A1:A5,"<>0")

Last edited:

#### ExcelRoy

##### Well-known Member

Hi AnalystJames,

Still not correct im afraid

I thought it was there at first but still not showing what I need

Thanks

#### ExcelRoy

##### Well-known Member
Forgot to mention that the number of entries may vary so I was hoping for the formula to work out how many entries out of 5 possible

Thanks

#### AnalystJames

##### New Member

What is the answer you are expecting in the first and can you maybe give a second example that shows how the problem can change?

#### ExcelRoy

##### Well-known Member
Hi,

Example 1 (Actual at the moment)

97%
76%
118%
-
77%
Expected Result 92% based over the 4 out of 5 entries

Now depending on different data this will change to example 2

54%
118%
224%
307%
284%
Expected Result 247% based over the 5 out of 5 entries

The "-" for no entry would need to be ignored in any calculation

Hope this makes sense

Many thanks

#### AnalystJames

##### New Member
How are you calculating 247? I am doing (54+...+284)/5

#### ExcelRoy

##### Well-known Member
yes I thought I was too

should be 197

Sorry

Replies
2
Views
63
Replies
3
Views
50
Replies
0
Views
281
Replies
12
Views
270
Replies
3
Views
145

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,163,517
Messages
5,832,225
Members
430,117
Latest member
RRattle

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back