=OR(IF(AND(....),HYPERLINK....

G

Guest

I need to have a formula that says if one cell says CO and another says Y
then another cell links off to the hyperlink otherwise it says pending. This
is fine and it works:

=IF(AND(AQ61="Y",B61="CO"), HYPERLINK($AW$61&C61&".pdf","Approved"),"Pending")


However the cell that says CO can also say PO and these will hyperlink off
to somewhere else so I need to do an OR function. I did a simple version
with TRUE/FALSE instead of the hyperlink and that works fine:


=OR(IF(AND(AQ61="Y",B61="CO"),TRUE,FALSE),IF(AND(AQ61="Y",B61="PO"),TRUE,FALSE))

However when I put the hyperlink in it comes back as #VALUE:

=OR(IF(AND(AQ61="Y",B61="CO"),
HYPERLINK($AW$61&C61&".pdf","Approved"),"Pending"),IF(AND(AQ61="Y",B61="PO"),
HYPERLINK($AW$60&C61&".pdf","Approved"),"Pending"))


Does anyone have any ideas what I need to change to make it work please?
Thanks.
 
G

Guest

Think it's just an error in the IF construct ..

This is incorrect:
=OR(IF(AND(AQ61="Y",B61="CO"),TRUE,FALSE),IF(AND(AQ61="Y",B61="PO"),TRUE,FALSE))

It should be structured as something like this:
=IF(AND(AQ61="Y",B61="CO"),"Hyper1",IF(AND(AQ61="Y",B61="PO"),"Hyper2","Pending"))

Above applied with your working hyperlinks inserted:

=IF(AND(AQ61="Y",B61="CO"),HYPERLINK($AW$61&C61&".pdf","Approved"),IF(AND(AQ61="Y",B61="PO"),HYPERLINK($AW$60&C61&".pdf","Approved"),"Pending"))

should work fine

---
 
G

Guest

You look at these functions for too long you can't see the obvious!
Thanks heaps Max.
 

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