Some argue that the Bible is contradictory concerning who bought Joseph, whether it was the Ishmaelites or the Midianites. The argument is that Genesis 37:28 and 39:1 say that the Ishmaelites bought Joseph, but Genesis 37:36 says that the Midianites bought Joseph. However, there is a simple explanation that resolves this alleged contradiction.
Then Midianite traders passed by. And they drew Joseph up and lifted him out of the pit, and sold him to the Ishmaelites for twenty shekels of silver. They took Joseph to Egypt.Genesis 37:28
Now Joseph had been brought down to Egypt, and Potiphar, an officer of Pharaoh, the captain of the guard, an Egyptian, had bought him from the Ishmaelites who had brought him down there.Genesis 39:1
Meanwhile the Midianites had sold him in Egypt to Potiphar, an officer of Pharaoh, the captain of the guard.Genesis 37:36
It is likely that in these passages, Ishmaelites and Midianites referred to the same group of people. In Judges 8:22-26, the two words are used interchangeably:
22 Then the men of Israel said to Gideon, “Rule over us, you and your son and your grandson also, for you have saved us from the hand of Midian.” 23 Gideon said to them, “I will not rule over you, and my son will not rule over you; the Lord will rule over you.” 24 And Gideon said to them, “Let me make a request of you: every one of you give me the earrings from his spoil.” (For they had golden earrings, because they were Ishmaelites.) 25 And they answered, “We will willingly give them.” And they spread a cloak, and every man threw in it the earrings of his spoil. 26 And the weight of the golden earrings that he requested was 1,700 shekels of gold, besides the crescent ornaments and the pendants and the purple garments worn by the kings of Midian, and besides the collars that were around the necks of their camels. Judges 8:22-26
Here, Gideon delivered the Israelites from the Midianites (verse 22), and he requested the earrings from these people he just defeated, and they are referred to in verse 24 as the “Ishmaelites.” Then, in verse 26, the passage goes back and says that this jewelry came from the Midianites. So, Midianites and Ishmaelites are being used interchangeably.
Also, Achtemeier says that “Ishmaelites” and “Midianite” probably referred to the same general group of people who descended from Abraham. Ishmael and Midiah were both sons of Abraham, and it is likely that their descendants mingled with one another over time. Achtemeier also says this:
The term ‘Midianite’ probably identified a confederation of tribes that roamed far beyond this ancestral homeland, a usage that explains the biblical references to Midianites in Sinai, Canaan, the Jordan Valley, Moab, and Transjordan’s eastern desert.Achtemeier, Paul J., Harper’s Bible Dictionary, San Francisco: Harper and Row, 1985.
Similarly, Keil and Delitzsch say this:
The different names given to the traders…do not show that the account has been drawn from different legends, but that these tribes were often confounded, from the fact that they resembled one another so closely, not only in their common descent from Abraham (Gen 16:15 and 25:2), but also in the similarity of their mode of life and their constant change of abode, that strangers could hardly distinguish them, especially when they appeared not as tribes but as Arabian merchants, such as they are here described as being (1996).Keil, C.F. and F. Delitzsch (1996), Keil and Delitzsch Commentary on the Old Testament (Electronic Database: Biblesoft), new updated edition.
To read more answers to alleged and apparent contradictions in the Bible, see “Contradictions” in the Bible Answered.
These books are also excellent resources: