# if statement()

#### OWAIZ

##### Board Regular
Hi Guys,
i have a small query, i am inserting a formula in a excel report i.e. if (b10, b11, b12, b15, c11, c22, d33 = blank, "Report Incomplete" Report Complete.

How can i go about logically and how to use the IF formula..

Pls guide.

Thanks & Regards
owaiz

### Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
you can embed up to 7 IF's within one formula.

The key to remember is the style...

IF(Test, Do If Test True, Do If Not True)

If embedding - instead of putting in the bit relating to Do If Not True - put in the next IF.

So say a=2

IF(A=1,"a equals 1",IF(A=2,"a equals 2","a equals neither 1 nor 2))

You want IF(OR(A1="",A2="",A3=""),"Incomplete","Complete")

Or if it's conditional on ALL cells being blank then

IF(AND(A1="",A2="",A3=""),"Incomplete","Complete")

This is another option for you:

Take you 7 cells and create a named range for them call RqdData. Then use this formula to ensure all 7 have data in them:

=IF(COUNTA(RqdData)=7,"ok","error")

Hi THere,
i tried working on the formula suggested by u, it works, but even one of the cell is filled in it's says:report complete: i want until and unless all the fields are filled in it should not show report complete..

pls help

thanks & Regards
owaiz

This code will require that a value be entered in a cell. This is useful when you create a form for others to fill out and it has required fields. Place this code in the sheet module. Substitute the correct cell addresses.

Option Explicit
Dim Mandatory As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Cells.Count > 1 Then Exit Sub
Case "\$A\$5", "\$A\$10", "\$A\$15", "\$A\$20", "\$A\$25", "\$A\$30"
Set Mandatory = Target
Case Else
If Not Mandatory Is Nothing Then
If Mandatory = "" Then
Mandatory.Select
MsgBox "You cannot leave this cell blank"
End If
End If
End Select

End Sub

Replies
4
Views
228
Replies
25
Views
1K
Replies
3
Views
299
Replies
1
Views
264
Replies
6
Views
774

1,219,807
Messages
6,150,349
Members
450,952
Latest member
Zung

### 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.

### Which adblocker are you using?

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

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