Welcome to the forum. I can see that you have already demonstrated your strength by posting here. Well done you! It is great to see you reaching out for some support during this obviously stressful time. I remember along time ago being in a similar situation as you are in regards to my year 12 formal. It was a tough time as I didn't have a close group of mates I could go with but I eventually approached a group of people and they had me along with them and I actually had a really good time in the end. It is risky taking that step towards asking a people you are not sure of to join their group as there is the risk of being rejected. It is also really nice to know that you have some close friends even though they are not attending.
Sometimes, talking out loud about this helps like getting support from someone close to you. I wonder if you have spoke to your parents or other family or your close friend about your situation? They could offer you some advise and support and then, if things don't go as you hoped, you have someone you can talk to and maybe even try a different approach.
You would be surprised at how many people find (and have found) Year 12 formals to be a really stressful time. The pressure we place on ourselves to to be included and accepted can be so overwhelming. But at the end of the day, if you want to go and check it out, you might find that attending, even with an unfamiliar group, can be really empowering (if you keep your expectations at bay).
If you are up in the middle of the night and just want someone to talk to about your worry and sadness, don't hesitate to call the KidsHelpLine 1800 55 1800 or https://kidshelpline.com.au/teens
Sometimes just talking about things out loud can make a huge different. And if hour comfortable, and you feel better writing about how you're feeling, please continue to reach out here on the forum. We are here and we are listening.