+ Reply to Thread
Results 1 to 3 of 3

Need another formula

  1. #1
    Lee
    Guest

    Need another formula

    Ok, I'm using the formula =SUMIF(B1,"=X",A1) to show the value of cell A1
    only if cell B1 has an "X". I want to include the value of 2 other cells
    along with cell A1 but only if cell B1 has the "X".
    --
    Lee Davenport

  2. #2
    joeu2004@hotmail.com
    Guest

    RE: Need another formula

    "Lee" wrote:
    > Ok, I'm using the formula =SUMIF(B1,"=X",A1) to show
    > the value of cell A1 only if cell B1 has an "X".


    First, why would you use SUMIF() for this purpose? That's
    like "killing an ant with a sledgehammer". Why not simply
    one of the following?

    =if(B1 = "X", A1, 0)
    =(B1 = "X")*A1

    > I want to include the value of 2 other cells along with cell
    > A1 but only if cell B1 has the "X".


    Will one of the following fit the bill?

    =if(B1 = "X", sum(A1:A3), 0)
    =if(B1 = "X", A1+A3+A5, 0)
    =(B1 = "X")*sum(A1:A3)
    =(B1 = "X")*(A1+A3+A5)

  3. #3
    Lee
    Guest

    RE: Need another formula

    Thanks. That worked perfectly.
    --
    Lee Davenport


    "joeu2004@hotmail.com" wrote:

    > "Lee" wrote:
    > > Ok, I'm using the formula =SUMIF(B1,"=X",A1) to show
    > > the value of cell A1 only if cell B1 has an "X".

    >
    > First, why would you use SUMIF() for this purpose? That's
    > like "killing an ant with a sledgehammer". Why not simply
    > one of the following?
    >
    > =if(B1 = "X", A1, 0)
    > =(B1 = "X")*A1
    >
    > > I want to include the value of 2 other cells along with cell
    > > A1 but only if cell B1 has the "X".

    >
    > Will one of the following fit the bill?
    >
    > =if(B1 = "X", sum(A1:A3), 0)
    > =if(B1 = "X", A1+A3+A5, 0)
    > =(B1 = "X")*sum(A1:A3)
    > =(B1 = "X")*(A1+A3+A5)


+ 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