You can't ignore, even though today some militaries stupidly try to, that the average women is physically weaker than the average man. IOW, a female phalanx? Slaughtered by the all-male phalanx. A mixed-gender phalanx then? Like a chain, a phalanx is only as strong as it's weakest link... Female archers perhaps? Outranged by male archers, who will also maintain a higher rate of fire, ...
What you can do, is to allow the small percentage of women who are strong enough into the army. Another option is to use women as auxiliary forces to swell your numbers. But this is only an advantage if you use them in addition to the all-male main army, replacing a single male unit with a female unit will weaken your force. So this can only be done if you are capable of supporting a larger force in the field than you have men to field. Lastly, there are militias, city militias in particular, during a siege every warm body with eyes, feet and two arms can help in the fight...