All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
It is proved in the books of Imaams Al-Bukhari and Muslim that Zayd bin Arqam was asked, "How many Ghazwaat (plural of Ghazwah, which is a military expedition led by the Prophet ) did the Prophet undertake?" Zayd replied, "Nineteen." They said, "In how many did you participate?" He replied, "Seventeen." I (the narrator from Zayd) asked, "Which of these was the first?" He replied, "Al-'Asheerah or 'Aseerah."
The authors who compiled books about the biography of the Prophet said the number of Ghazwaat were twenty five. It is also said that they were twenty-seven, and yet another opinion is that they were twenty-nine.
Imaam Ibn Hajar after citing the above sayings, mentioned that the way to correlate between the above various opinions, is that the ones who narrated the greater numbers of Ghazwaat counted every Ghazwah separately even if it had occurred shortly before the next Ghazwah. While the ones who narrated smaller number of Ghazwaat or an average number of Ghazwaat might have combined between the ones that occurred within a close period and considered them as one Ghazwah. For example, the Battle of the Trench and the Battle of Bani Quraythah, and the Battle of Hunayn and the Battle of Taa’if could have been combined as only two instead of four.
As for As-Saraaya (army battles in which the Prophet did not participate), they are more than the Ghazawaat and the difference in opinion regarding their number is even more. The number of As-Saraaya ranges from forty to seventy.
Ibn Hajar wrote, 'I read by the handwriting of Al-Mughaltaay that the total number of Ghazwaat and As-Saraaya is hundred. The fact is as he wrote.'"
Allaah Knows best.