You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

CURRENCYH function on weekends

I'm having a problem using the CURRENCYH function for historical currency rates. If the date field is a weekend, the formula returns an error. Instead, I'd need it to use Friday's closing price. Any thoughts?


I suppose I could create a nested IF/THEN statement so that if an error is returned, it subtracts 1 from the date, and if that returns an error, it subtracts 2. But was hoping for a more elegant solution.

MacBook Pro 15″, macOS 11.6

Posted on May 10, 2022 12:42 PM

Reply
5 replies

May 10, 2022 11:02 PM in response to Yo_Be_Low

Please check one thing before you implement this.


What will you get if the Monday or Friday is a public holiday? Don't think that there will be an official closing price.

Example: Monday, May 31st 2021 was Memorial Day in the US, therefore a public holiday.


WORKDAY is an elegant way for most weekends, but you may need IF/THEN for some special weekends.


Ralf


May 11, 2022 1:05 AM in response to Ralf-F

I don't know about all holidays but May 31, 2021 and Dec 25, 2020 both have values from CURRENCYH. I have not used the function extensively so I don't know if there are other holidays for which it has no data (not counting problems with the data server). Those days will be errors if there are any. STOCKH does not have data on holidays.


As SGIII said, the My Stocks template changes error values into "-" and filters them out so you don't see them. It will hide weekends, holidays, and any other day without data. Unfortunately, the server (Yahoo Finance) too often does not give data on valid days and those days will be covered up by the filter. As I write this, the server quit providing any data for stocks or currencies. Could just be me but everything else internet-related seems to be working fine and it was too, at the beginning.

CURRENCYH function on weekends

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.