More syntax headaches

N

Nick Xylas

Once again, I need the help of the clever people on this group in
parsing a formula. Here's the setup:

Cell A1 is the cell the formula goes in.

If cell AA7 equals the text value "YES" (itself the result of a
calculated formula), then A1=1.
If cell AA7 is zero, and AB7 contains an asterisk (again the result of
a calculated formula), then A1 is left blank.
If AA7 is zero and AB7 is blank, the A1=0
If AA7 contains any other numeric value besides zero, then that value
is reproduced in A1.

AB7 either contains an asterisk or is left blank, so testing whether
AB7="*" or testing whether it is nonblank will both work equally as
well.

Thanking you in advance.
 
K

KC Rippstein

=IF(AA7="YES",1,IF(AA7=0,IF(AB7="",0,""),IF(ISNUMBER(AA7),AA7,NA()))

If it helps you, you can break out these nested IF formulas vertically using
Alt+Enter and indenting spaces. Sometimes that's easier to visualize the
logic.
=IF(AA7="YES",
1,
IF(AA7=0,
IF(AB7="",
0,
"" ),
IF(ISNUMBER(AA7),
AA7,
NA() )
)
 
P

Pete_UK

Try this:

=IF(AA7=0,IF(AB7="*","",IF(AB7="",0,"not
specified")),IF(AA7="YES",1,IF(ISNUMBER(AA7),AA7,"not specified")))

You can see that there are a few situations that your description does
not cover.

Hope this helps.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top