The prohibition: It is forbidden to count Jews [in numbers such as 1, 2, 3 etc]. [This applies whether one is counting individual Jews or is counting the Jewish people as a whole. Rebbe Elazar says that anyone who counts the Jewish people transgresses a negative command. Rav Nachman Bar Yitzchak says he transgresses two negative commands. This statement is not recorded in the Poskim, and practically, it is disputed as to whether counting the Jewish people is of Biblical or Rabbinical status.]
For non-census taking purposes: The above prohibition applies even if one intends to do so for [an external purpose, such as for] the sake of a raffle, in which a certain amount and number have been chosen [to win the prize, and he wants to count the people for the sake of knowing who will win the prize]. [It goes without saying that it is forbidden to count them for the sake of census taking.]
For the sake of a Mitzvah: It is forbidden to count Jews even for the sake of a Mitzvah [such as to count how many people are around for a Minyan].
How to count in a permitted way:
Coming up in Part 2!
 Admur 156:15; M”A 156:2; Peri Chadash 55:1; Rambam Temidin 4:4; Rebbe Yitzchak in Yuma 22b “It is forbidden to count the Jewish people even for a Mitzvah” based on Mishneh in Yuma 2:2 that the Kohanim would stick out their fingers for the raffle; Brachos 62b that even children know of this prohibition; Pesachim 54b; Sefer Haitim in name of Rav Haiy Gaon; Sefer Pardes of Rashi 99; Sefer Haorah of Rashi 1:56; Rashi Shmuel 1:15-1; Chesed Lealafim 55:10; Kaf Hachaim 55:11; Tzitz Eliezer 7:3 in length; Toras Menachem 5743 2:1138 [printed in Shulchan Menachem 1:203]; Piskeiy Teshuvos 156:24
 The source: This is deduced from the verse [Shmuel 1:15-4] “Vayishma Shaul Es Ham Vayifkideim Betelaim,” which describes that when Shaul counted the Jewish people, he counted them using sheep. [Yuma ibid] It is also learned from the fact Hashem had the Jewish people donate a half Shekel in order for Moshe to count them. [See Brachos 62b] Regarding the novelty of the ruling in Yuma from Shmuel versus that in Brachos from the Torah, some say that in Ki Sisa there is no explicit prohibition and thus the novelty in Yuma is that it is prohibited to do so. [Maharsha Yuma ibid] Alternatively, although the general prohibition is learned from Ki Sisa/Brachos, from Yuma ibid we learn that one may not count the Jewish people even for the sake of a Mitzvah. [Iyun Yaakov Yuma ibid; Pirush Hataz Al Hatorah; Hagahos Maharsham Yuma ibid] Alternatively, from Ki Sisa/Brachos we only learn of the prohibition to count the entire Jewish people, while from Yuma ibid we learn that one may not count even part of the Jewish people. [Chida in Eiyn Zocher Yuma ibid; Sefas Emes Yuma ibid] Alternatively, from Ki Sisa/Brachos we only learn of the prohibition to count the Jewish people for census purposes, while from Yuma ibid we learn that one may not count the Jewish people even for an external reason, such as for a raffle. [Chasam Sofer Chadashos 8] See Tzitz Eliezer 7:3 in length
The reason: Counting the Jewish people brings danger upon them, as all counted items are subject to Ayin Hara. [Rashi on Ki Sisa 30:12; See Bava Metzia 42a “Blessing is only found on that which is hidden from the eye”; Michaber O.C. 230:2] This was seen in the times of David, who Hashem punished to forget this law, and due to him counting the Jewish people he caused Avishai Ben Tzruya to be killed. [Brachos ibid; See Shmuel 2:24] The reason for this is because when one counts every individual separately, it arouses Divine scrutiny on each individual according to their standing, and could cause retribution for sins they may have. This is in contrast to including the entire Jewish people as a whole, in which they are scrutinized and judged as a community more than individually, and hence the sinner can find refuge in the community’s standing. This can be learned from the story with the Shunamis, who told Elisha the prophet that she does not want to be individually mentioned, and would rather be included amongst the rest of the nation. [Rabbeinu Bechayeh Ki Sisa ibid] Alternatively, counting each Jew individually separates one from his friend and forfeits the Divine blessing attributed to unity. [Panim Yafos Bamidbar 2:1]
 Yuma ibid; Omitted by Poskim ibid, Vetzaruch Iyun. See previous footnote regarding if the prohibition is of Biblical or Rabbinical status.
 Is the prohibition of Biblical or Rabbinical status? From the verses brought in Yuma ibid it is implied that the prohibition is due to Divrei Kabalah [Navi] and is hence of Rabbinical status. However, from the verse brought in Brachos ibid, it is implied that it is of Biblical status. Practically, some Poskim conclude that it is of Rabbinical status. [Chavos Yair 9; Rav Parlo on Rasag L.S. 264-265 based on the fact it is omitted from all Monei Hamitzvos; Sdei Tzufim on Yuma ibid based on response of Avraham the son of the Rambam] Others however conclude it is of Biblical status. [Divrei Emes of Rav Yitzchak Becher of Kushta 1700, Lavim p. 86; Shevet Halevi 9:35 in name of Chasam Sofer; See Tzitz Eliezer 7:3 in length]
 Admur ibid; M”A ibid; Yuma ibid; Sefer Hapardes of Rashi 99