Need help with IF statement


Posted by Dan on December 10, 2001 4:43 AM

I need to create an IF statement that shows if data has been entered into the cells or not. It would show either 'completed' or 'fill in details' and is dependant on three cells being filled in correctly!

Help!

Posted by Aladin Akyurek on December 10, 2001 4:58 AM

What are the expected inputs and their data type (numeric or text)?

Posted by Dan on December 10, 2001 5:01 AM

It's a mixture of both. I just needs to register that the cells have been filled in. The cells are validated so if the cell has registered the value, you can continue.


It would show either 'completed' or 'fill in details' and is dependant on three cells being filled in correctly!

Posted by Troy on December 10, 2001 5:02 AM


This will work as long as you dont need to know which ones are blank
=IF(AND(ISBLANK(A2),ISBLANK(A3),ISBLANK(A4)),"fill in details","complete")

Posted by Aladin Ayurek on December 10, 2001 5:15 AM

Dan --

If you are making use of formulas in data validation, you can just string them together within the condition part of an IF-formula, or, as you seem to care about, use:

=IF(AND(LEN(A1),LEN(A2),LEN(A3)),"Completed","Fill in details")

Aladin

Posted by Dan on December 10, 2001 5:24 AM

And what about if i wanted to assign a value of a cell in place of 'completed' and 'enter....'? Putting 'B1','C1' wouldn't work would it?

Posted by Aladin Akyurek on December 10, 2001 5:37 AM

A different formulation

Lets say that you want to control the input by using data validation in A1, A2, and A3 in Sheet1.

In a different sheet (Sheet2, which I usually name Blackboard), enter in cell1 a formula that checks what is entered in A1, another formula in cell2 to check what is entered in A2, and yet another formula in cell3 to check what is entered in A3. Design these formulas in such a way that they return a logical value (that is, either TRUE or FALSE). Example of such a formula would be:

=Sheet1!A1>0 [ returns TRUE if a positive number is entered in A1 ]

Name cell1 (via the Name Box) e.g., Input1, cell2 Input2, and cell3 Input3.

Now you can put on A1 data validation by choosing Custom for Allow and entering the formula:

=Input1

Follow the same steps for A2 and A3.

Now you can have a formula in Sheet2,say in cell4,

=AND(cell1,cell2,cell3) [ name this cell InputOK? via the Name Box ]

that can be used more effectively in other formulas in your workbook as in:

=IF(InputOK?,VLOOKUP(...))

Aladin

========== Dan --

Posted by Aladin Akyurek on December 10, 2001 5:40 AM

Not sure about what you want, but

=IF(AND(LEN(A1),LEN(A2),LEN(A3)),B1,C1)

would be a legitimate formula.

Aladin

==========



Posted by Mark W. on December 10, 2001 10:41 AM

Here's a solution with fewer function calls...

=IF(COUNTBLANK(A2:A4),"fill in the blanks","complete") I need to create an IF statement that shows if data has been entered into the cells or not. It would show either 'completed' or 'fill in details' and is dependant on three cells being filled in correctly!