Numbers spreadsheet formula for military combat calculator

Spreadsheet Military Combat Calculator - help needed

I'm creating a Numbers Spreadsheet Sprite Calculator for my 4X game. I have 22 different military units, their names are all listed in the Column A2-A23. They are also listed as 2 Letter abbreviations on the top row B1-W1. I have a separate sheet containing the individual stats for each military unit, this is named "Unit Stats". The corresponding sheets use the same identical names as the Calculator Sheet. The corresponding cross referenced cell needs to display the remaining HP (Health) of the attacking unit 1st and the defending unit 2nd (both in the same cell).


Could someone please help me, by providing a line of "Spreadsheet code" that I can paste into all the Combat Sheet cells, so I don't have to do it the hard way. Note: these units are for game launch, I have a total of 80 units which will be released over the following three years, I don't want to manually do this for 6,400 cells.


For simplicity for you, the row names are called, Unit1, Unit2, Unit3 etc listed in Columns A2-A23 and then U1, U2, U3 etc for the Column names listed in A1-W1 as the Unit Titles. Note: Unit1 is the same unit as U1, therefore if Unit1 attacks U1 it will be the same two units, of course they will only use either an Attack or Defense stat.


I have a pre-made formula that works perfectly in a small Comat calculator, which I use manually for individual combat testing. The Spreadsheet we are creating requires the HP (full unit health), Att (Attack value of the unit initiating the combat) the attacker always receive a 0.5 attack bonus, which is added to the Att. Whereas the Defending unit uses its Def strength (not its Att). The defender receives a defense bonus which I want to place in a cell for game adjustment purposes.


Note: There are 5 different Defense bonuses 100%, 125%, 150%, 200% and 300%. that part of the formula can be obtained from the input in its cell called DB (Defense bonus) which I will insert into the formula. I will not provide the combat formula, simply write "Insert Formula" where it needs to go.


Please ask for more information as needed. I will be most grateful for this help.


Best wishes

Joey

MacBook Pro 15″, macOS 14.4

Posted on Aug 21, 2026 1:20 PM

Reply
3 replies

Numbers spreadsheet formula for military combat calculator

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.