help with statements

jmazorra

Well-known Member
Joined
Mar 19, 2011
Messages
715
Hello

I am having trouble with a formula, Basically it is supposed to solve the following statement:

If k1:k6 = "E" and if r1:r6>=1 then average b1:b6 and if the answer is 0 return a value of N/A

The other statement I am have trouble with is similar and it goes like this:

if k1:k6 = "E" and if and if m1:m6="f" and if r1:r6>=1.0 then average b1:b6 and return a value of N/a if the answer is 0

Any help will be appreciated

Thanks
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
First question:

=IF(ISERROR(AVERAGE(IF($K$1:$K$6="E",IF($R$1:$R$6>=1,B1:B6)))=0),NA(),AVERAGE(IF($K$1:$K$6="E",IF($R$1:$R$6>=1,B1:B6))))
 
Upvote 0
Hello

I am having trouble with a formula, Basically it is supposed to solve the following statement:

If k1:k6 = "E" and if r1:r6>=1 then average b1:b6 and if the answer is 0 return a value of N/A

The other statement I am have trouble with is similar and it goes like this:

if k1:k6 = "E" and if and if m1:m6="f" and if r1:r6>=1.0 then average b1:b6 and return a value of N/a if the answer is 0

Any help will be appreciated

Thanks
Try these...

If you're using Excel 2007 or later...

=IF(AVERAGEIFS(B1:B6,K1:K6,"E",R1:R6,">=1"),AVERAGEIFS(B1:B6,K1:K6,"E",R1:R6,">=1"),"N/A")

=IF(AVERAGEIFS(B1:B6,K1:K6,"E",M1:M6,"F",R1:R6,">=1"),AVERAGEIFS(B1:B6,K1:K6,"E",M1:M6,"F",R1:R6,">=1"),"N/A")

These array formulas** will work in ALL versions of Excel:

=IF(AVERAGE(IF(K1:K6="E",IF(R1:R6>=1,B1:B6))),AVERAGE(IF(K1:K6="E",IF(R1:R6>=1,B1:B6))),"N/A")

=IF(AVERAGE(IF(K1:K6="E",IF(M1:M6="F",IF(R1:R6>=1,B1:B6)))),AVERAGE(IF(K1:K6="E",IF(M1:M6="F",IF(R1:R6>=1,B1:B6)))),"N/A")

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
 
Upvote 0
Another way:

=IFERROR(1/(1/AVERAGEIFS(B1:B6,K1:K6,"E",R1:R6,">=1")), NA())
 
Upvote 0
Another way:

=IFERROR(1/(1/AVERAGEIFS(B1:B6,K1:K6,"E",R1:R6,">=1")), NA())
I like that one if they're using Excel 2007 or later. I don't know if they want the TEXT string N/A or the logical error value #N/A, though.

Nice one!
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,875
Members
452,949
Latest member
Dupuhini

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