G
gardenhead
Hello,
I'm trying to write a statement macro and one of the cells is a
comments section where it evaluates other cells in the row. However,
I've exceeded the number of IF statements by one:
=IF(A3="","", IF(COUNTIF(S$3:S$20000,A3)>1, "Duplicate or secondary
invoice in GP", IF(AND(ISERROR(H3),J3="Yes"), "Scheduled to pay/apply",
IF(J3="Yes","Paid/Applied", IF(K3="Yes", "Dropship import error",
IF(L3="Yes", "Duplicate or secondary invoice in VNet", IF(ISTEXT(E3),
"Open - Dropship", IF(ISNUMBER(E3), "Open - Owned Goods",
"Open"))))))))
Something a little more readable:
If A3 = "" Then
Print ""
Elseif A3 is found in S3:S20000 more than once Then
Print "Duplicate or Secondary Invoice"
Elseif H3 is an Error AND J3 = "Yes" Then
Print "Scheduled to pay/apply"
Elseif J3 = "Yes" Then
Print "Paid/Applied"
Elseif K3 = "Yes" Then
Print "Dropship import error"
Elseif L3 = "Yes" Then
Print "Duplicate or secondary invoice in VNet"
Elseif E3 ISTEXT Then
Print "Open - Dropship"
Elseif E3 ISNUMBER Then
Print "Open - Owned Goods"
Else
Print "Open"
End If
At first I tried to use two Named Formulas to bypass my way around the
limitation but I kept getting a #VALUE error and I couldn't figure out
why. I don't have any VBA coding experience so I'm wondering if someone
can translate the above into a function? If someone sees a way to make
the original formula more condensed that'd be great too.
Thanks in advance...
I'm trying to write a statement macro and one of the cells is a
comments section where it evaluates other cells in the row. However,
I've exceeded the number of IF statements by one:
=IF(A3="","", IF(COUNTIF(S$3:S$20000,A3)>1, "Duplicate or secondary
invoice in GP", IF(AND(ISERROR(H3),J3="Yes"), "Scheduled to pay/apply",
IF(J3="Yes","Paid/Applied", IF(K3="Yes", "Dropship import error",
IF(L3="Yes", "Duplicate or secondary invoice in VNet", IF(ISTEXT(E3),
"Open - Dropship", IF(ISNUMBER(E3), "Open - Owned Goods",
"Open"))))))))
Something a little more readable:
If A3 = "" Then
Print ""
Elseif A3 is found in S3:S20000 more than once Then
Print "Duplicate or Secondary Invoice"
Elseif H3 is an Error AND J3 = "Yes" Then
Print "Scheduled to pay/apply"
Elseif J3 = "Yes" Then
Print "Paid/Applied"
Elseif K3 = "Yes" Then
Print "Dropship import error"
Elseif L3 = "Yes" Then
Print "Duplicate or secondary invoice in VNet"
Elseif E3 ISTEXT Then
Print "Open - Dropship"
Elseif E3 ISNUMBER Then
Print "Open - Owned Goods"
Else
Print "Open"
End If
At first I tried to use two Named Formulas to bypass my way around the
limitation but I kept getting a #VALUE error and I couldn't figure out
why. I don't have any VBA coding experience so I'm wondering if someone
can translate the above into a function? If someone sees a way to make
the original formula more condensed that'd be great too.
Thanks in advance...