+ Reply to Thread
Results 1 to 3 of 3

Four variables dynamic table with formulas in the cells to find average and total # cells

  1. #1
    Registered User
    Join Date
    10-29-2020
    Location
    Lancaster, Canada
    MS-Off Ver
    Office 365 Excel
    Posts
    2

    Question Four variables dynamic table with formulas in the cells to find average and total # cells

    I am creating a tool to help me with a game that I am playing. I want to be able to see how increasing or decreasing certain statistics on my character favour or disadvantage me against other opponents in order to spend in-game currency on improvements to the abilities of my character in the most efficient and effective manner.

    One aspect of the game is applying and receiving damage to and from an opponent. The applied damage is not fixed, but variable between two numbers (for example 220-256). The damage that the game randomly generates between those two numbers is mitigated by a second set of numbers similar to the first (for example 45-73). That number is also random. I want to be able to come up with an average of the total of every combination possible. This means that I would have a table (using the examples above) that is 37 x 29. This would not be hard if I only ever cared about one opponent, but I make comparisons to many different opponents throughout the game and the table sizes change every time a delta in damage and/or mitigation occur.

    Variables

    Lower Damage (LDmg) min 1
    Upper Damage (UDmg) max 2000
    Lower Absorb (LAbs) min 1
    Upper Absorb (UAbs) max 1000

    Table
    number of Columns = UDmg - LDmg + 1 = x
    number of Rows = UAbs - LAbs + 1= y

    The top left cell contains a formula that results in an answer equal to LDmg-LAbs
    The bottom left cell contains a formula that results in an answer equal to LDmg-UAbs
    The top right cell contains a formula that results in an answer equal to UDmg-LAbs
    The bottom right cell contains a formula that results in an answer equal to UDmg-UAbs


    Restrictions

    x < 200
    y < 200
    Negative values become zero (one cannot apply negative damage).

    Example 1

    Inputs
    UDmg=20
    LDmg=16
    x=5
    UAbs=5
    LAbs=4
    y=2
    Table would look like

    11 12 13 14 15
    12 13 14 15 16

    Outputs
    Average 13.5
    Number of cells would be x * y = 10



    Example 2

    UDmg=40
    LDmg=30
    x=11
    UAbs=36
    LAbs=31
    y=6

    Table would look like
    0 0 1 2 3 4 5 6 7 8 9
    0 0 0 1 2 3 4 5 6 7 8
    0 0 0 0 1 2 3 4 5 6 7
    0 0 0 0 0 1 2 3 4 5 6
    0 0 0 0 0 0 1 2 3 4 5
    0 0 0 0 0 0 0 1 2 3 4
    Average 2.345
    Number of cells would be x * y = 66

    SOLUTION WAS to create a 200 x 200 table with conditional IFs that made the cells blank when others were blank or zero.
    Last edited by Bandelar; 11-01-2020 at 04:07 PM. Reason: [SOLVED]

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Four variables dynamic table with formulas in the cells to find average and total # ce

    Hi there.

    A picture is worth 1,000 words. An Excel sheet is worth 1,000 pictures.

    Please read the yellow banner about sample worksheets, at the top of the screen. Act on its guidelines and post a SMALL sample sheet.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    10-29-2020
    Location
    Lancaster, Canada
    MS-Off Ver
    Office 365 Excel
    Posts
    2

    Re: Four variables dynamic table with formulas in the cells to find average and total # ce

    File attached
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. formulas based on pivot table cells not dynamic && GetPivotData form not flexible
    By foxtrotter in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-09-2019, 04:54 PM
  2. Count cells in a dynamic range, calculate their percentage in respect to total cells.
    By DimitriosNikolouzos in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-24-2019, 11:36 AM
  3. Cant find how to get average dates difference between averaged cells, w/out extra cells
    By jeremyharrisonspo in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-10-2014, 08:20 PM
  4. Replies: 1
    Last Post: 08-26-2013, 08:01 AM
  5. Replies: 10
    Last Post: 04-25-2013, 06:12 PM
  6. Average the last 10 cells of a dynamic column but ignore blank cells & 0
    By mattadler22 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-13-2013, 11:37 PM
  7. [SOLVED] find blank cells in column and average the cells below
    By desibabuji in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-03-2013, 12:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1