+ Reply to Thread
Results 1 to 4 of 4

Excel If function

  1. #1
    Registered User
    Join Date
    09-09-2008
    Location
    Ottawa
    Posts
    3

    Excel If function

    Not sure if I am using the correct function but I have a question. I am creating a worksheet to track (manually) banking. In column B, I put in the name of the company, in C i put in the amount of Credit, in D, the Debit amount then E contains the bank balance (almost like a chequing book). Columns F though M contain the company names, then in turn each of them are summed at the bottom. Pretty simple. The question I have is...

    If I have the company in column B named XYZ company and they are a grocer, I want to move the contents of the amount in column D over to Column F, easy enough...

    =SUM(IF($B$9:$B$103="XYZ",D9,0))

    But what if I want to perform the check and put the sum total in for mutiple grocer sites... So, I want to add grocer ABC as well. Using the same logic, I put in this formula, but I get an error.

    =SUM(IF($B$9:$B$103="XYZ",D9,0)),(IF($B$9:$B$103="ABC",D9,0)))

    Am I using the proper operand? I tried "OR" but got no where as all I got was TRUE and FALSE statements!

    thanks,

    Swaff -)

  2. #2
    Forum Contributor vandanavai's Avatar
    Join Date
    09-04-2006
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    256

    Re: Excel If function

    Hello

    I think u need Array Formula. Could u please upload sample filr?

  3. #3
    Registered User
    Join Date
    09-09-2008
    Location
    Ottawa
    Posts
    3

    Re: Excel If function

    Sure,

    here is the Excel worksheet.

    Swaff -)
    Attached Files Attached Files

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Excel If function

    Perhaps:

    =SUM(IF(($B$9:$B$103="XYZ")+($B$9:$B$103="ABC"),$D$9:$D$103,0))

    confirmed with CTRL+SHIFT+ENTER

    or

    =SUMPRODUCT(($B$9:$B$103="XYZ")+($B$9:$B$103="ABC"),$D$9:$D$103)

    Confirmed with just ENTER
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ 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