[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 125
  • Last Modified:

Expanding my IF statement

Folks,
Below you will see in the formula bar an IF statement that is not getting what I would like.
#DIV/0! errorMy 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"
0
Frank Freese
Asked:
Frank Freese
  • 6
  • 4
  • 2
  • +2
3 Solutions
 
Randy PooleCommented:
The first part should be:
=IFERROR(AVERAGE(N6:N10),"Error")

Try that and see if returns what your looking for
0
 
NorieCommented:
You can't use a formula to place a value in another cell.
0
 
Randy PooleCommented:
Ok and for the 2nd part in P6 place
=IF(O6="Error","Please refer to Remarks","Ok")
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
duncanb7Commented:
IFERROR(AVERAGE(N6:N10),"ERROR")  putting on cell O6

and

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


Duncan
0
 
Frank FreeseAuthor Commented:
I think you all got it!
0
 
Frank FreeseAuthor Commented:
great job...thank you
0
 
duncanb7Commented:
Thanks for your points

Have a nice day

Duncan
0
 
Frank FreeseAuthor 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
 
Martin LissRetired ProgrammerCommented:
Try this formula
=IF(OR(O6="",O6=0), " ", IF(O6=AVERAGE(N6:N10),"Correct","Incorrect"))
0
 
Frank FreeseAuthor 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
 
Martin LissRetired ProgrammerCommented:
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

Open in new window

0
 
Martin LissRetired ProgrammerCommented:
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

Open in new window

0
 
Frank FreeseAuthor Commented:
I accepted the second post, at this time.
0
 
Martin LissRetired ProgrammerCommented:
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
 
Frank FreeseAuthor 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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 6
  • 4
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now