# Expanding my IF statement

Folks,
Below you will see in the formula bar an IF statement that is not getting what I would like.
My objective is this:
If there's a #DIV/0! error in cell O6, in cell P6 I would like to do this:
Replace the #DIV/0! in cell O6 with "Error" and in P6 have a remark saying "Please refer to Remarks". If no #DIV/0! error in O6 then in P6 have a remark saying "OK"
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
The first part should be:
=IFERROR(AVERAGE(N6:N10),"Error")

Try that and see if returns what your looking for
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

VBA ExpertCommented:
You can't use a formula to place a value in another cell.
0
Commented:
Ok and for the 2nd part in P6 place
0
Commented:
IFERROR(AVERAGE(N6:N10),"ERROR")  putting on cell O6

and

IF (O6="ERROR","please refer to remark","OK") putting on cell P6

Duncan
0
Author Commented:
I think you all got it!
0
Author Commented:
great job...thank you
0
Commented:

Have a nice day

Duncan
0
Author Commented:
My pleasure, however, I spoke a little early. I'm having a problem still but haven't figured out how to solve it yet
0
Older than dirtCommented:
Try this formula
=IF(OR(O6="",O6=0), " ", IF(O6=AVERAGE(N6:N10),"Correct","Incorrect"))
0
Author Commented:
You're a good man Martin. This problem was just solved with my last post. I've decided to move away from the Correct/Incorrect.
However, I was preparing another post to you regarding printing we spoke of the other day.
0
Older than dirtCommented:
Consider changing your Worksheet_Activate events to something like this (for the AVERAGE sheet).
``````Private Sub Worksheet_Activate()
With Worksheets("Average")
.Range("O6").ClearContents
.Range("N6") = 8
.Range("N7") = 7
.Range("N8") = 9
.Range("N9") = 6
.Range("N10") = 10
End With
ActiveSheet.Range("O6").Select
End Sub
``````
0
Older than dirtCommented:
And instead of putting that code in the Activate event and the TryAgain sub change the Activate event to
``````Private Sub Worksheet_Activate()
TryAgain
ActiveSheet.Range("O6").Select
End Sub
``````
0
Author Commented:
I accepted the second post, at this time.
0
Older than dirtCommented:
I know. My last two posts are just suggestions about what you could do when refreshing the sheet so that the data you put there would show up again after the user fooled around, left the sheet and came back, or clicked the TryAgain button. If however you were going to leave N6:N10 blank then my suggestions don't apply and in that case you might as well get rid of the TryAgain buttons.
0
Author Commented:
OK...now I understand and  I like the idea of first providing data they can work with. I think I'll keep the Try Again forcing them to reenter the formula (of course they could simply change the values and it recalculates automatically, unless I disabled automatic recalc for each sheet. Then I would have to .......rats Martin! I'm making things hard for me. I'll have to rest on this.
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.