+ Reply to Thread
Results 1 to 10 of 10

Summing the results of nested IFs

  1. #1
    Registered User
    Join Date
    10-27-2011
    Location
    Wellingborough, England
    MS-Off Ver
    Excel 2011
    Posts
    13

    Summing the results of nested IFs

    I know this is going to be something exceptionally simple and it's because I'm doing it via IF's (which technically return either a 0 or 1 for true of false) so I'll probably kick myself when you come back with a totally obvious answer.

    I have this formula: =IF(J5="","",IF(C5="","",K5)) which returns either a value of 10p or £1.00 based on the results of the IF's, this formula is copied down for about 70 rows (with the row ref's increasing in each instance of the formula).

    For a bit more reference;
    Cell J5 is just a yes or no drop down
    It checks C5 to ensure it's not blank
    and K5 is =IF(C5="","",IF(J5="No","10p","£1.00"))
    (I'm beginning to think I've made this too complicated for what it needs to be!)

    What I want to do is have one cell that totals all the amounts into one easy to read figure for a sales spreadsheet to help work out our profit margin on a batch of data.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Summing the results of nested IFs

    Just an idea.

    =IF(C5="","",IF(J5="No",0.10,1))

    Format the cell as you want.

    Then>>>=SUM(K5:K1000)
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,814

    Re: Summing the results of nested IFs

    Use this formula:

    =SUM(K5:K100)

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    10-27-2011
    Location
    Wellingborough, England
    MS-Off Ver
    Excel 2011
    Posts
    13

    Re: Summing the results of nested IFs

    Quote Originally Posted by Fotis1991 View Post
    Just an idea.

    =IF(C5="","",IF(J5="No",0.10,1))

    Format the cell as you want.

    Then>>>=SUM(K5:K1000)
    That works, but I unfortunately need to know the result of each lead's value to us (10p or £1.00) in one cell, then add all of them together later

    Quote Originally Posted by Pete_UK View Post
    Use this formula:

    =SUM(K5:K100)

    Hope this helps.

    Pete
    That's what I tried and I get a result of 0 as it's not summing values, but results of IF's.

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Summing the results of nested IFs

    =sumif(j5:j100,1,k5:k100)

    =sumif(j5:j100,0.10,k5:k100)

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,814

    Re: Summing the results of nested IFs

    Change this formula =IF(C5="","",IF(J5="No","10p","£1.00")) in K5 to this:

    =IF(C5="","",IF(J5="No",0.1,1.0))

    then copy down. If you put quotes around numeric values then they become text values, which are treated as zero.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    10-27-2011
    Location
    Wellingborough, England
    MS-Off Ver
    Excel 2011
    Posts
    13

    Re: Summing the results of nested IFs

    Quote Originally Posted by Pete_UK View Post
    Change this formula =IF(C5="","",IF(J5="No","10p","£1.00")) in K5 to this:

    =IF(C5="","",IF(J5="No",0.1,1.0))

    then copy down. If you put quotes around numeric values then they become text values, which are treated as zero.

    Hope this helps.

    Pete
    Perfect, this worked

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Summing the results of nested IFs

    ..Just curious..

    Why the suggestion of post2, didn't work?

    Seems same to me with this of post6!

  9. #9
    Registered User
    Join Date
    10-27-2011
    Location
    Wellingborough, England
    MS-Off Ver
    Excel 2011
    Posts
    13

    Re: Summing the results of nested IFs

    Essentially it would have done, it was just the extra formatting which I messed up on as well. Thank you for helping as well.

  10. #10
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,814

    Re: Summing the results of nested IFs

    Perhaps you can mark the thread as solved if you consider it to be so - the FAQ describes how to.

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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