+ Reply to Thread
Results 1 to 9 of 9

Embedding a SUM statment within an IF statement

  1. #1
    Registered User
    Join Date
    10-12-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    4

    Embedding a SUM statment within an IF statement

    So first off I suck at excel but I am trying to get the statement only run if the G Column is equal to 71 and if its not do nothing and another formula will calculate it. So here is what I have.

    Please Login or Register  to view this content.
    The Sum code works before I wrap it in a IF statement I get a #Value! back I have been pasting different code together to get to this point but any help would be appreciated. I am not sure if this will even work. Also if anyone could explain if there is a better way to deal with the false statement because if it is equal to 91 its supposed to get totaled somewhere else.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Embedding a SUM statment within an IF statement

    Explain in words what you want that formula to do.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    10-12-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    4

    Re: Embedding a SUM statment within an IF statement

    The SUM formula just totals up costs related to budget. in the F5 and down cells. So users can go in and add the costs. The IF would just check that if the cell next to the cost is a "71" fund type if its not it wont run the SUM formula

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Embedding a SUM statment within an IF statement

    =IF(G5:G65535=71,SUM(F5:INDEX(F5:F65536,MATCH(TRUE,INDEX(ISBLANK(F5:F65536),0,0),0)-1,0)),"91")
    What is the "91" for?

  5. #5
    Registered User
    Join Date
    10-12-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    4

    Re: Embedding a SUM statment within an IF statement

    91 is the different fund type I was not sure if I had to put a value the false IF

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

    Re: Embedding a SUM statment within an IF statement

    Try

    =SUMIF(G5:G65535,71,F5:F65536)

  7. #7
    Registered User
    Join Date
    10-12-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    4

    Re: Embedding a SUM statment within an IF statement

    God that was so much easier than I was making that, it works perfectly thank you Jonmo1

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Embedding a SUM statment within an IF statement

    Quote Originally Posted by mforsberg1 View Post
    91 is the different fund type I was not sure if I had to put a value the false IF
    I think you can just do this:

    =SUMIF(G:G,71,F:F)

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

    Re: Embedding a SUM statment within an IF statement

    You're welcome.

    Tony's version with the entire column references would be simpler. Assuming no possible 71 entries in rows 1 through 4 (seems very likely that's the case).

+ 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(AND statement followed by IF statment
    By Founty in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-10-2016, 01:18 PM
  2. PDF Embedding
    By TDoss in forum Excel General
    Replies: 2
    Last Post: 06-12-2015, 02:02 PM
  3. Replies: 0
    Last Post: 06-21-2012, 11:30 AM
  4. Replies: 2
    Last Post: 06-06-2012, 10:59 PM
  5. [SOLVED] IF statment within IF statment?
    By DaZombie in forum Excel General
    Replies: 2
    Last Post: 10-27-2010, 12:33 PM
  6. Embedding If Statement into SUMPRODUCT
    By rhudgins in forum Excel General
    Replies: 2
    Last Post: 01-19-2010, 06:35 PM
  7. Embedding IF statements into IF statement
    By prefcomm in forum Excel General
    Replies: 4
    Last Post: 04-03-2009, 09:52 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