# How many friends were invited by you Vs How many friends were you invited by?

I am confused which type of passive sentence should be used and why

Active

How many friends did you invite?

Passive

1 How many friends were invited by you?

or

2 How many friends were you invited by?

The two sentences mean quite different things.

The one you want (the one that has the same meaning as your original sentence) is the first option:

How many friends were invited by you?

This means that "you" is having a party and invited several people and the asker is inquiring how many people were invited to the party. I will note that this phrasing sounds quite odd to me because it implies that several people are inviting friends to the event and someone is asking how many you, specifically, invited, as if to compare numbers.

A - I hear there's a big party at your house this weekend.
B - Yes. I'm throwing it with two other people. We're expecting about 50 people.
A - How many people were invited by you?
B - Only about 15 of them.

As you can see, this does the work of emphasizing which people B invited himself. This can be done in the active form by emphasizing the word you.

How many friends were you invited by?

The second option means "How many friends invited you [to the party]". As if many people were having an event and you were the target of their invitation. The main time I see this used is when very popular girls in high school-centric films are asking each other how many guys invited them to the prom (a school dance).

A - How many guys have asked you to prom?
B - Five!
A - Wow, I've only had three.

It looks like the sentence 1 is demonstrating on the invitation to friends rather than you. While in sentence 2 you were invited by the friends, so number of friends who invited you is being asked there. So, I hope sentence 1 is correct.