I have several years' experience with 8 photovoltaic panels, a 2500W inverter, and a 24V battery bank made from 8 golf cart batteries.
Manufacturers rate solar PV panels at the highest watts they'll put out.
The ones I used were rated 64W. One would deliver 3 or 4 amps into a 12V battery.
Open circuit voltage was 23 V. That's with no load. Voltage would drop to varying degrees depending on what load was attached.
I tested a panel with various loads. The greatest power output occurred with a 6 ohm load. Then voltage was about 16. Current flow 2.7 A.
As a rough estimate, to power a 5000 W inverter at 24V input, you'll need:
100 panels rated 50 W each.
or 50 panels rated 100 W each.
or 25 panels rated 200 W each. Etc.
To deliver 24 V to your inverter, you'll need setup A or B or C below:
(A) If your load is unchanging then each panel must contain the exact number of cells which you have found will stay at 24V in accord with the load it sees in your inverter. This may or may not be the same number of cells built into a typical PV panel.
Setup A is hard to live with you can't easily divide up PV panels. Changing sunlight will change PV output unpredictably. Furthermore some inverters may refuse to operate when fed greater than a certain voltage.
............ or
(B ) If your load is changing than you'll need a DC-DC converter set to provide 24 V output regardless of the voltage coming from your panels.
How many cells should go in each panel, or how many panels to string in series, depends on the specs of your converter.
..............or
(C) Use a 24V battery bank hooked up to a PV array. PV panels are strung as two panels in series, and you'll parallel sufficient strings to power your inverter.
In this case the battery serves as a voltage regulator so as to maintain 24 V at the inverter input.