i had a similar problem a while back - try this:
once yosemite is downloaded, save a copy to an external device for backup purposes.
format the drive where yosemite is to be installed (currently connected to your mac air).
drag / copy the install file to the drive that is to have yosemite installed.
go to that drive, double click the install file to begin the installation process, a drive list will be presented for the installation, obviously select the drive that is connected externally that will ultimately return to the laptop as it's internal drive.
once installation is complete, shut down the mac air with the drive and it's new os system installed still connected externally.
restart your mac while holding down the option (alt) key until you are presented with an option of drives to boot from, one will be your mac, the other will be the drive connected externally.
select the externally connected drive.
your mac air should now boot from the external drive with the freshly installed os.
if it boots correctly from that drive, you should be able to pop it back into the laptop it came out of & boot that machine up normally.
if that machine then fails to boot again, it is a hardware issue with that particular laptop causing the problem - not the drive itself.