+ Reply to Thread
Results 1 to 6 of 6

IF statement to get a return value that adds up values from two cells?

  1. #1
    Registered User
    Join Date
    05-14-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    32

    IF statement to get a return value that adds up values from two cells?

    Hello. I have three columns on my data:
    COlumn A: consist of text of "Nice" or "Bad"
    Column B: all numeric
    Column C: all numeric

    I want the IF statement to do this:

    =IF(Column A="Bad", SUM the values in Column B and C or else give me value in Column C)

    Does it make sense?

    So my True statement needs to give me the SUM of the value in Column B and C, if it meets the statement...

    Can anyone help? Thank you!!!!

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: IF statement to get a return value that adds up values from two cells?

    Try

    =C2+B2*(A2="Bad")

  3. #3
    Registered User
    Join Date
    05-14-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: IF statement to get a return value that adds up values from two cells?

    I just tried...it doesn't work when A2 does not equal to Bad, when A2 doesnt even to Bad i do not need those two columns to be sum i just need value from Column C.
    so i was writing this: =IF(A2="Bad", SUM of B2+C2, C2)

    I think i am almost there....i just need someone to fix the SUM piece...

    please help!!

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: IF statement to get a return value that adds up values from two cells?

    It works for me.

    EFrcocalm.xlsx


    Here's how it works

    =C2+B2*(A2="Bad")

    A2="Bad" is a True or False result.
    So let's say A2 DOES = Bad for now.
    =C2+B2*(TRUE)

    when doing math on a True/False result, TRUE = 1, FALSE = 0
    =C2+B2*(1)

    B2*(1) = B2
    =C2+B2


    IF A2 does NOT = Bad
    =C2+B2*(FALSE)
    =C2+B2*(0)
    B2*(0) = 0
    =C2+0
    =C2
    Last edited by Jonmo1; 12-02-2013 at 05:14 PM.

  5. #5
    Registered User
    Join Date
    05-14-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: IF statement to get a return value that adds up values from two cells?

    I just fixed it and now it is working...So for my own knowledge, is this not a typical IF statement? What does it call? what does the * in the statement actually do here?

    Thank you very much!!

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: IF statement to get a return value that adds up values from two cells?

    * = multiplication
    2*4 is saying (2 multiplied by 4)

    You didn't really need an IF in this case, based on the assumption of only 2 possible values in the cell (Nice or Bad)
    So we only need a True or False based on the test if the cell = BAD
    If the Cell DOES = Bad, then it's true.
    If the cell Does NOT = Bad, then we can assume it must equal Nice.

    And you wanted C to be included in the sum regardless if A is Bad or Nice.
    Only B is inclucded or excluded based on if A is Bad or Nice.


    Hope that helps.

+ 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. If statement that adds depending on the value
    By timweb in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-02-2013, 12:26 PM
  2. Replies: 3
    Last Post: 11-14-2012, 05:27 PM
  3. Replies: 2
    Last Post: 11-12-2012, 06:26 AM
  4. Replies: 0
    Last Post: 12-22-2011, 03:42 PM
  5. Replies: 3
    Last Post: 11-22-2007, 07:53 AM

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