+ Reply to Thread
Results 1 to 5 of 5

AND IF Statement??? Not sure the formula to use

  1. #1
    Registered User
    Join Date
    07-21-2007
    Posts
    13

    AND IF Statement??? Not sure the formula to use

    Hoping to get some help with this one.... I have a sheet of data and want to count how many oranges I have in total. I need to create a formula that counts the number of oranges. Keeping in mind that Cells C14, C30, C42 and C50 might change at any given time.

    How do I create an if statement that counts the number of fruits if Cells C14,C30, C42 and C50 = Orange?

    The Values of the fruits are always in Column G, one row under the row with the fruit

    Cell C 14 Orange
    Cell G15 3
    Cell C30 Pear
    Cell G31 5
    Cell C 42 Apple
    Cell G43 6
    Cell C50 Orange
    Cell G 51 8


    Hope this makes sense
    Thanks!

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Try:

    =SUMIF(C14:C50,"Orange",G15:G51)

    HTH

    Jason

  3. #3
    Registered User
    Join Date
    07-21-2007
    Posts
    13

    Sumif other than range?

    Thanks for the reply, however can the sumif function be done with only select cells rather than a range of cells?

    The formula:
    =SUMIF(C14,C30,C42,C50,"Orange",G15,G31,G43,G51)

    The above formula does not work -

    Reason being is I have other #'s in Column G that I do not want to sum.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,698
    Is there any pattern to the cells you want to look at...or perhaps there is consistent text in column B for the rows you want to consider? E.g if you only want to look at column C when B says "fruit"

    =SUMPRODUCT(--(B14:B50="fruit"),--(C14:C50="orange"),G15:G51)

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    Quote Originally Posted by bwhizz
    Reason being is I have other #'s in Column G that I do not want to sum.
    By that statement, do you mean that you have "Orange" in other cells in row C and don't want to include the value in G(+1) for those oranges?

    If Not, then Jason's formula will work.

    ChemistB

+ 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