Unsure why getting #VALUE error in a AVERAGE(IF(SUBTOTAL... formula

ashleighbrown

New Member
Joined
Mar 10, 2023
Messages
8
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I'm trying to write a formula that calculates the average of a score (a decimal value) depending upon what level the assessment was (1-6), so there is an average score for each assessment level. However I'd like for the formula to display the average score depending upon the visible data so if the sheet is filtered by a class it'll update to show that classes average and not the overall. However the formula is pulling a '#VALUE!' error and I can't work out why as I'm not super familiar with some of the functions like ROW and OFFSET I'm having to use.

The formula as it stands is:
=AVERAGE(IF(SUBTOTAL(2,OFFSET(S55,ROW(S55:S60)-ROW(S55),0)),IF(R55:R60="1",S55:S60)))

1684151649499.png


Where the data it is looking at is
:
1684151557769.png

(This isn't the actual data but I was practicing on some random values that are structured the same to see if I could work out what the issue is, so its definitely a typed value with no spaces so I don't think that is the issue)

If anyone has any ideas it would be super helpful!

Thank you :)
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Try confirming the formula with Ctrl Shift Enter, rather than just enter.
 
Upvote 0
You also need to remove the quotes from the "1"
 
Upvote 0
You also need to remove the quotes from the "1"
Ohhh this has worked thank you so much! I'm so used to having references to strings of text which I always write in quotations rather than numbers I didn't realise the "" weren't necessary if it was a pure numeric value - thank you!!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top