View Single Post
  #2   Report Post  
Duke Carey
 
Posts: n/a
Default

Each IF() is a complete standalone & you've tried to put them together
separated by commas. So, the first two should be combined like so:

=IF(AND(D3="Back Up",E3="ABCD04C00",F3<=6),"10.10.1.0 /22",IF(AND(D3="Back
Up",E3="ABCD04C01",F3<=6),"10.10.2.0 /22", - next if() - and so on

However, everything you've listed can (almost) be simplified to this:

=IF(AND(D3="Back Up",left(E3,8)="ABCD04C0",F3<=6),"10.10."&right(E3 ,1)&".0
/22","0")

The (almost) is there because the left 8 characters of E3 might fit the
pattern but not meet one of your specified conditions.

Another way to do this would be to list the possible E3 entries in one
column and the desired result in the adjacent, right-hand column. Then your
formula could be:

=IF(AND(D3="Back Up",F3<=6),VLOOKUP(E3, two-column range, 2,0,"")


"JB" wrote:

I've created the following formula,
=IF(AND(D3="Back Up",E3="ABCD04C00",F3<=6),"10.10.1.0 /22","0"),
IF(AND(D3="Back Up",E3="ABCD04C01",F3<=6),"10.10.2.0 /22","0"),
IF(AND(D3="Back Up",E3="ABCD04C02",F3<=6),"10.10.3.0 /22","0"),
IF(AND(D3="Back Up",E3="ABCD04C03",F3<=6),"10.10.4.0 /22","0"),
IF(AND(D3="Back Up",E3="ABCD04C04",F3<=6),"10.10.5.0 /22","0"),
IF(AND(D3="Back Up",E3="ABCD04C05",F3<=6),"10.10.6.0 /22","0")

The first expression from =sign to )parenthesis, works well, however, when I
add the additional expressions, I get the following result #VALUE!. I need to
know how to make this work to allow me to obtain a variety of TRUE results. I
will need to add approximately 100 expressions. If these is a more efficient
way to accomplish this, I'm all ears. All suggestions are welcome.