+ Reply to Thread
Results 1 to 2 of 2

Excel 2007 : Calculations using IF statement?

  1. #1
    Registered User
    Join Date
    08-12-2010
    Location
    NJ
    MS-Off Ver
    Excel 2007
    Posts
    1

    Calculations using IF statement?

    Good day everyone. I'm trying to sum cells if 2 other cells are equal which is easy enough but I don't want to display the value of the 2nd equal cell, which I am doing by setting that to zero. But if I have a cell that is not equal to another cell, I do want to display that value.

    Hopefully, the attached spreadsheet will show what I'm attemtping. The 2nd block is how I would like it to come out.

    I want to only show one value for the cells that have equal values in cell A but not list the value of the 2nd or subsequent matching cells. But if I have an occurence in cell A that is only listed once I want to show that value in cell C.

    My formula is: =IF(A1=A2,B1+B2,"0") and I realize that's why a unique occurence is being listed as zero also.

    Hope that makes sense. Please let me know if you need more info.

    Thanks
    Jay
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    08-23-2009
    Location
    Hampshire, UK
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    328

    Re: Calculations using IF statement?

    If your data starts in A2 you can use the following formula in C2 and copy down

    =IF(A2=A1,0,SUMIF($A$2:$A$10,A2,$B$2:$B$10))

    Adjust the range to suit your data

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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