It's also possible to create the adgroups, ads, and keywords in the same spreadsheet.
Say for instance that you had the following two spreadsheets, one to create ad groups:
Campaign , Ad group , Default Max. CPC
Campaign name, New ad group 1, 0.94
Campaign name, New ad group 2, 0.73
And one to create keywords:
Campaign , Ad group , Keyword , Max. CPC
Campaign name, New ad group 1, banana , 0.44
Campaign name, New ad group 1, apple , 0.24
Campaign name, New ad group 2, strawberry, 1.28
Campaign name, New ad group 2, rambutan , 1.94
You could then instead use a single spreadsheet which'd look like this:
Campaign , Ad group , Default Max. CPC, Keyword , Max. CPC
Campaign name, New ad group 1, 0.94 , ,
Campaign name, New ad group 2, 0.73 , ,Campaign name, New ad group 1, , banana , 0.44
Campaign name, New ad group 1, , apple , 0.24
Campaign name, New ad group 2, , strawberry, 1.28
Campaign name, New ad group 2, , rambutan , 1.94
Basically, add column headers for each entity type, and then leave the corresponding cells empty if they don't apply for that row. If it's possible for you to generate your uploads in a format like this, that'd guarantee that the ad groups get created first.