Praise be to Allah.
It is haraam to consume intoxicants during Ramadan and at other times; the prohibition is more emphatic during Ramadan.
The fast is valid if he intended it from the night before and sobered up partway through the day. If he did not sober up at any time during the day, then his fast is not valid and he must make it up.
Zakariyya al-Ansaari said in Sharh Manhaj at-Tullaab ma‘a Haashiyat al-Bujayrimi (2/76): The conditions are that one be Muslim, and of sound mind, and free of menses and the like, throughout the day. If the opposite of any of these applies to a person during part of the day, his fast is not valid, similar to the ruling on prayer.
The fast is not affected if he sleeps the entire day, or if he is unconscious or intoxicated for part of the day, unlike if he is unconscious or intoxicated for the entire day, because being unconscious or intoxicated mean that a person is no longer fit to comply with religious duties, unlike being asleep, because the one who missed the prayer due to being asleep must make it up, unlike the one who missed the prayer due to being unconscious or intoxicated.
I added the idea of intoxication because if someone consumes an intoxicant at night and sobers up partway through the day, his fast is valid. End quote.
Sulayman al-Jamal said in his commentary on Sharh al-Manhaj (2/334): Conclusion: If unconsciousness or intoxication, whether done deliberately or otherwise, last all day, then that day’s fast must be made up. Otherwise, if it does not last all day, and the person intended to fast from the night before, his fast is valid. End quote.
Loss of awareness through intoxication invalidates wudoo’, but does not require ghusl.
Ibn Qudaamah (may Allah have mercy on him) said: Loss of awareness is of two types: due to sleep and due to other causes. With regard to causes other than sleep, that refers to insanity, unconsciousness, intoxication and medicines that cause loss of awareness. This invalidates wudoo’, whether the duration is brief or lengthy, according to scholarly consensus.
End quote from al-Mughni (1/128).
And he said: Ghusl is not required of one who becomes insane or loses consciousness, if they recover without having a wet dream. I do not know of any scholarly difference of opinion concerning that…
That is because loss of awareness in and of itself does not necessitate ghusl, and there is some doubt as to whether ejaculation occurred; that which is certain cannot be cancelled on the basis of uncertainty.
If it is certain that ejaculation occurred in these two cases, then they must do ghusl, because that is required in the case of a wet dream, so it is included among the things for which ghusl is required that are mentioned above.
End quote from al-Mughni (1/155).
This person who became intoxicated must repent to Allah, may He be exalted, and do wudoo’ and pray. His fast is valid, even if his wudoo’ was delayed, because wudoo’ is only required when one wants to pray and the like, and has nothing to do with the validity of the fast.
And Allah knows best.