+ Reply to Thread
Results 1 to 7 of 7

Adding numbers if several conditions are true

  1. #1
    Registered User
    Join Date
    08-28-2019
    Location
    Barcelona
    MS-Off Ver
    2017
    Posts
    12

    Adding numbers if several conditions are true

    Hello,
    I'm making a video game were some objects can have 1 or several improvements that have effect their statistics.
    I'm trying to calculate the statistics of my objects if 1 or several improvement are true (available for the player). If one improvement is true, then it's true for all the objects.

    In my example attached, I have 3 different train that have different speed. You can put 2 speed improvement on them.
    If one improvement is true, then the improvement value and the train value are added.

    My problem is that I can check if one value is true and make the calculation, but I have no idea how to do it for a huge database. Any solution I can think of give me wrong results

    Tanks For your help!
    Attached Files Attached Files
    Last edited by Goauld; 08-06-2020 at 07:56 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,418

    Re: Adding numbers if several conditions are true

    Please explain in detail your expected speed results.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    08-28-2019
    Location
    Barcelona
    MS-Off Ver
    2017
    Posts
    12

    Re: Adding numbers if several conditions are true

    Ok sorry!

    In my example, the first train has 80 speed.
    The first improvement gives 10 speed.
    The second improvement gives 30 speed

    If the player has no improvement, the speed stays at 80
    If the player has only the first improvement, the final result is 90
    If the player has only the second improvement, the final result is 110
    If the player has the first and second improvement, the final result is 120

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,418

    Re: Adding numbers if several conditions are true

    Player?

    There are no players defined on your sheet.

    How do we know if the invisible player has the first, second or both improvements? Where is that indicated?

  5. #5
    Registered User
    Join Date
    08-28-2019
    Location
    Barcelona
    MS-Off Ver
    2017
    Posts
    12

    Re: Adding numbers if several conditions are true

    It's in the table B14 - B 15.
    If a improvement is true, I put a 1 (meaning the player has it). If a improvement is false (player doesn't have it), I put a 0.
    The final result is expected in the table "Improvement Simulation", in the orange cells (C9 - C11)

    I simulate only 1 player at the time, so I put the datas needed manually in B14 - B15

  6. #6
    Registered User
    Join Date
    01-23-2020
    Location
    Spain
    MS-Off Ver
    2007
    Posts
    22

    Re: Adding numbers if several conditions are true

    Try using in cell C9

    =C3+sumproduct($B$14:$B$15;$J$3:$J$4)

    Is this what you needed?

  7. #7
    Registered User
    Join Date
    08-28-2019
    Location
    Barcelona
    MS-Off Ver
    2017
    Posts
    12

    Re: Adding numbers if several conditions are true

    SAI80. Yes it's working! I could even do just =C3+$B$14*$J$3+$B$15*$J$4
    I feel stupid now XD

    Thanks!

+ 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. when two conditions true get values
    By nnish in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-21-2016, 08:35 AM
  2. If 3 conditions are true
    By Tortus in forum Excel General
    Replies: 3
    Last Post: 07-02-2015, 02:04 PM
  3. Change from checking if 2 conditions are true to if any of 4 conditions are true
    By tafoyavision in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-26-2014, 02:17 PM
  4. Replies: 1
    Last Post: 03-26-2014, 02:14 PM
  5. [SOLVED]True, False conditions and numbers to grab
    By S3b in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-20-2011, 03:18 PM
  6. Adding numbers, multiple conditions
    By Robby in forum Excel General
    Replies: 2
    Last Post: 11-30-2009, 04:27 AM
  7. adding up numbers with multiple conditions
    By cornnfedd in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-21-2007, 09:20 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