TRIM -- will remove surplus leading & trailing spaces from a string... so " Hello " would become "Hello"... this was used because on your sample file some of your headers in Row 1 had surplus trailing spaces.
The HYPERLINK function has 2 arguments:
HYPERLINK(link location, [friendly name])
The latter argument is optional but is what you want to use to show different text to the actual link address...
eg
HYPERLINK("http://www.google.com","Google")
Would generate a link to the full URL but display "Google" in the cell.
You will notice that in the formula I provided I provided you with the friendly name:
=IF(OR(COUNT($A2:$B2)<2,C$1=""),"",HYPERLINK($A$1&"\"&TRIM(REPLACE(C$1,1,3,""))&"\"&TRIM(REPLACE(C$1,1,3,""))&" "&TEXT(SUM($A2:$B2),"MM-DD-YY h mm")&".pdf",TRIM(REPLACE(C$1,1,3,""))&" "&TEXT(SUM($A2:$B2),"MM-DD-YY h mm")&".pdf"))
The REPLACE was used to remove the "01 ", "02 " from the headers in row 1 when creating the string...
=REPLACE(text,start pos,num chars,new text)
eg
would generate: "llo" as 2 characters commencing from position 1 of the string Hello are replaced with nulll... this
=REPLACE("Hello",1,2,"x")
would generate: "xllo", as instead of Nulls ("") we use "x"
Going forward, please don't create new threads if the question you have is related to your current thread - raising the question in the same thread will get a resolution (as demonstrated).
I'm still curious as to your file path being a constant (01 USD-CAD) -- surely the other currencies reside in different folders, no ? The formula I provided would adapt the folder (01 USD-CAD) accordingly so you can apply a common formula across all currency pair columns (ie that provided previously) ... though seemingly the "01 " is important which I removed originally so I would revise it to:
=HYPERLINK($A$1&"\"&TRIM(C$1)&"\"&TRIM(REPLACE(C$1,1,3,""))&" "&TEXT(SUM($A2:$B2),"MM-DD-YY h mm")&".pdf",TRIM(REPLACE(C$1,1,3,""))&" "&TEXT(SUM($A2:$B2),"MM-DD-YY h mm")&".pdf"))
I'm also confused because your sample implied that the pair was included in the file name eg USD-CAD 02-11-09 0 00.pdf whereas again your latest formula implies this not to be the case - you're just using the Date & Time to create the file name - the pair is ignored (only relevant to the folder perhaps) ?
Regardless, if you're happy that's fine by me.
Bookmarks