HELP!! with SUBSTITUTE FUNCTION within an AVERAGE FUNTION. taking < values as the value and not as zero and then averaging within the same formula

Bigr2

New Member
Joined
Sep 3, 2015
Messages
9
I will try to explain my issue: I am being required to start sending a Monthly Monitoring Report to the State electronically. This report has always been done in excel and I have always reported my data in a manner where it is useful to me in other areas. The data is laboratory analysis data that is full of < values due to certain detection levels. The state report will make all of my < values (<20, <0.005) into zeros, which is what they want, however I would like to export the data to another workbook that will take all of my < values as the detection level (so <20 will need to reference 20 when averaging and not zero) for other record keeping purposes. On another report I do once every 5 years I cant use < values as zero, I have to use the detection level itself.

Ok so now the background is out of the way, If I have an entire column of <20 and other values, I want to average the entire column (skipping blank cells) with the formula seeing the <20's as 20, but visually being able to still see all the < values for reference. The closest I have come to accomplishing this is with the formula =(AVERAGE(SUBSTITUTE(RANGE OF CELLS,"<","")*1)) with CONTROL+SHIFT+ENTER to make it an array. This does exactly what I want it to do, but if there is a blank cell in the range it throws and error (#VALUE!). We do not collect data every day of the Month so it is essential that it skip the blank cells. I cannot change the formatting from the parent workbook so it will export or copy and paste to the states electronic submittal system. Any Help would be greatly appreciated.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Welcome to the MrExcel forum!

A word to the wise - it's usually better to open a new thread than stick your question on the end of a very old one. That said, try:

Book1
ABCDEF
1Sample Date:2/19/20202020Averages
2Cyanide mg/LNACyanide mg/L0
3Arsenic mg/L0.04Arsenic mg/L0.02401
4Cadmium mg/L0.00034Cadmium mg/L0.00027
5Chromium mg/L0.097Chromium mg/L0.0504
6Copper mg/L0.0193Copper mg/L0.0342
7Lead mg/L0.00187Lead mg/L0.001305
8Nickel mg/L0.154Nickel mg/L0.080955
9Silver mg/L0.00084Silver mg/L0.00047
10Zinc mg/L0.0323Zinc mg/L0.04985
11Sample Date:7/22/2020
12Cyanide mg/LNA
13Arsenic mg/L0.00802
14Cadmium mg/L<0.00020
15Chromium mg/L0.0038
16Copper mg/L0.0491
17Lead mg/L0.00074
18Nickel mg/L0.00791
19Silver mg/L<0.00010
20Zinc mg/L0.0674
Sheet7
Cell Formulas
RangeFormula
F2:F10F2=AVERAGE(IF($A$2:$A$20=E2,IFERROR(SUBSTITUTE($B$2:$B$20,"<","")+0,0)))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Wow! fast replies. I am about to head home for the day, but I will try these tomorrow. And if I still can't get it I will start a brand new thread. Thanks so much!!!
 
Upvote 0
Perhaps this:

=AVERAGE(IF($A$2:$A$36=E4,IF($B$2:$B$36<>"",IFERROR(SUBSTITUTE($B$2:$B$36,"<","")+0,0)),""))
Entered with CTRL + SHIFT + ENTER, not just ENTER.

Eric, I think you missed the blank rows in your sample.
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,537
Members
449,088
Latest member
RandomExceller01

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