Okay it looks like there's two parts to this question, first is getting the information you're looking for (the blender objects sorted by hierarchy) and second is exporting that somewhere else (Excel).
So for the first part:
Since the objects are stored in a python dictionary, they aren't in any order at all. So you'll need to write a small script to search through the objects and put them in order.
Something like the following rough code will organize them putting the parent object first, followed by its children. Based on code found here.
def hierarchy(ob):
objs = []
def recurse(ob):
objs.append(ob)
for child in ob.children:
recurse(child)
recurse(ob)
return objs
objs = []
for ob in (o for o in bpy.context.scene.objects if not o.parent):
objs.extend(hierarchy(ob))
Though this doesn't account for the arrangement of collections.
For the second, if all you need is to view it in the console, you could print the list like so:
for ob in objs:
print(ob.name)
If you aren't seeing enough of the output from your command, one option is to increase the console scrollback limit. This affects how far you can scroll up in the console using the mouse wheel. Go to Edit > Settings, then System > Memory & Limits > Console Scrollback Lines, and increase it to as much as you need.

But it sounds like you're hoping it export this into a spreadsheet, in which case your best bet might be to directly export it to a csv file that Excel could then open.
For that, something like this should work:
import csv
with open('output.csv', 'w', newline='') as csvfile:
writer = csv.writer(csvfile)
for ob in objs:
writer.writerow([ob.name])
This will create a csv file in the current directory with each name on a new row, though it can be tweaked to create whatever spreadsheet you need.