You're using the predicate nominative, so the pronoun should technically be in the nominative case (i.e. "If you were I"), but English speakers almost universally say and write "If you were me." "If...
You may say "I had no pencil," or you may say "I did not have any pencils" - whichever feels more natural to you. "Had no" would be used when speaking of a singular subject however.
The correct grammar is YOU AND I if used as a subject, e.g. ""You & I will have a jolly good time". Correct grammar requires YOU AND ME if used as an object, e.g. "This is just between you and...
'Were you' is grammatically correct, as it gives us a subject (you), and a time (past), although it is not a full sentence, which requires a location. So you could say 'Were you upstairs?' and it be...