How do you know his actions didn't affect her?
Last we see of Gamora is during the battle where she has a little spat with Quill, after that we don't see her.
For all we know she does actually survive the battle and Tony's snap.
Tony might have excluded her anyway
Gamora was seen fighting for the good guys on the field in the battle and Tony at least knows her name because Quill mentioned her multiple times in front of him.
It stands to reason that in the off screen time on Titan in Avengers: Infinity War
he may have described her more to see if they had seen her.
As such he may have excluded her.
Tony might not have seen her And if the previous point doesn't float your boat Tony might not have seen her in the battle anyway and as such might have excluded her on the grounds of not knowing she was there to be snapped.
The Stones may have decided As Paul D. Waite mentions in a comment Tony may have just decided to wipe out Thanos' forces and the Stones/Gauntlet themselves may have decided what constitutes someone working for Thanos.
As Gamora had switched sides at this point it may have left her alone.
scifi.stackexchange.com/users/58193/TheLethalCarrot
What's Tony got to do with anything?
Neither
did Thanos know half the people in the Universe.
In both Infinity War and Endgame it's implied that the stones are displaying some level of sentience in carrying out complex implementations of simple directives ("Kill half of everybody," "Kill all the bad guys") and that their awareness of the current state of reality includes who's naughty and who's nice - and, as such, would be aware that Gamora switched sides 7 scenes ago.
scifi.stackexchange.com/users/20490/gowenfawr
The Snapper decides who lived and who dusts out of existence as mentioned in the answer here .
Tony couldn't risk killing innocent people in the process.
So, this is what his actions could have actually meant: "Anyone who's allegiance is towards Thanos should be dusted" .
Since the past Gamora changed her sides and joined the present-day Nebula, her allegiance towards Thanos ended.
This could be the reason why she survived the snap (considering she did survive the snap).
And it's left to the stones (maybe the Soul Stone or Mind Stone ) to identify if she really parted ways from Thanos.
scifi.stackexchange.com/users/92306/Shreedhar
Tony Stark spent a lot of time with Nebula.
She might have told him about Gamora.
So he definitely knew about her.
scifi.stackexchange.com/users/116536/Sanath Kumar M
Gamora was never with Thanos, she was always setting herself up as a control rod to kill him if he ever got close to reaching his ultimate goal.
Since she would remain close enough to kill him if she pretended to be loyal
she did not have another, better choice to stopping him.
Consider her origin
the Mad Titan wiped out her mother and half her world then took her.
She was playing a very long game to get her personal justice and along the way she was being made stronger and understanding more about his ultimate goal and trying to find a way that she would stop him, she herself.
During her personal journey she had to keep closest to him and within his innermost circle of trust which meant completing with Nebula with Zero chance of compassion, as that could jeopardize her mission.
Consider meeting up with the Guardian's and taking one or more of the stones out of play the first real chance she had to break out of a lifetime undercover as an evil 'daughter' and show her true self.
I'm just amazed
Thanos did not realize this at some point, at least enough to know how deep down he failed and thus disqualify the love he thought he had for her, and then regain that love with the respect she maintained for her true purpose - to Kill Thanos/Stop his Infinity Stones quest.
I think there was a missed repartee just before he sacrificed her for the soulstone.
She could tell him how she really felt, he would get angryish and sad
she could then say this disqualified her as a sacrifice, then he would make peace with what he made her and respect her will and love her for it , maybe even more.
scifi.stackexchange.com/users/116637/Banthapodoo
At the end of  Avengers: Endgame  Iron Man    snapped his fingers with the Infinity Stones to erase all of the villains.   As Tony does not know     who Gamora is.   How can she survive this as she was coming with Thanos and was considered as a bad girl in the beginning of the battle?
Why doesn't Iron Man's action affect this person in Endgame?
scifi.stackexchange.com
<marvel><marvel-cinematic-universe><iron-man><avengers-endgame>
scifi.stackexchange.com/questions/212332
scifi.stackexchange.com/users/116336/TinyDoowy
It is not clear whether this action affected Gamora or not as she is not seen following the battle. Furthermore, Gamora is seen fighting for the good guys and so may well have been left alone because she switched sides. Tony may have also chosen to exclude her from this particular action. This is open to interpretation - maybe she survives or maybe not. Tony Stark might have excluded her after what Quill told him and Stones - which seem to be sentient - might have recognised that she was not with Thanos and therefore should be excluded from the kill order.
Perhaps she does survive - Tony might have excluded her after what Quill said or the Stones themselves might have recognised that she was not with Thanos forces. The Stones are sentient and so would see that Gamora switched sides 7 scenes earlier. Tony wouldn't risk killing innocent people - the Stones would identify her as innocent. Maybe Nebula told Tony about Gamora so her spared her because of that. Gamora was never with Thanos in the first place - she wanted revenge and had to pretend to be with him in order to get close to him.