Praise be to Allah.
Having the right intention is one of the conditions of acts of worship – fasting and others – being valid. No act of worship is valid unless it is accompanied by the intention, because of the report narrated by al-Bukhaari (1) and Muslim (1907) from ‘Umar ibn al-Khattab (may Allah be pleased with him) who said: “Actions are but by intention, and each one will have but that which he intended.”
An-Nawawi (may Allah have mercy on him) said:
What this hadith means is that actions are only reckoned on the basis of the intention, and they do not count if they are done without an intention. This indicates that purification – including wudoo’, ghusl and tayammum – is not valid unless it is accompanied by the intention. The same applies to prayer, zakaah, Hajj, i‘tikaaf (devotional retreat) and all other acts of worship. End quote.
In the case of all obligatory fasts – which includes those done to make up for missed obligatory fasts – it is essential to have the intention from the night before.
The scholars of the Standing Committee said:
Forming the intention during the night, before dawn breaks, to fast the entire day is obligatory according to Islamic teaching, because of the hadeeth of Hafsah (may Allah be pleased with her), from the Prophet (blessings and peace of Allah be upon him), that he said: “Whoever does not intend to fast before dawn breaks, his fast does not count.” Narrated by the authors of as-Sunan.
End quote from Fataawa al-Lajnah ad-Daa’imah (9/147)
Ibn Baaz (may Allah have mercy on him) said:
With regard to the fasts of Ramadan, fasts observed in fulfillment of vows, expiatory fasts, and fasts done to make up for fasts missed during Ramadan, it is essential to form the intention the night before.
End quote. http://www.binbaz.org.sa/mat/13420
Please see also the answer to question no. 26863
With regard to the intention – in order for it to be valid – it is essential to be firmly resolved; if there is no firm resolve, then the intention is not valid.
Zakariya al-Ansaari said in Asna’l-Mataalib (1/411):
With regard to fasting, it is essential to have a firm, specific intention, as in the case of prayer. All of that must occur before dawn breaks in the case of obligatory fasts, even those done in fulfilment of vows, making up missed obligatory fasts or as expiation, even if the one who is forming the intention is a child, because of the report: “Whoever does not intend to fast before dawn breaks, his fast does not count.” Narrated by ad-Daaraqutni and others; they classed it as saheeh. End quote.
Based on the above:
The fast that was done on the day of ‘Arafah counts as a naafil (supererogatory) fast only, because this is the intention that preceded the action. As for the earlier intention of making it an obligatory fast, it does not count because it was not formed the night before and that was not the basis of the action when starting the action.
And Allah knows best.