+ Reply to Thread
Results 1 to 13 of 13

if statement needed

Hybrid View

  1. #1
    lrbtav@gmail.com
    Guest

    if statement needed

    Here is my scenario:

    I have two workbooks in one xls file. Workbook 1 takes values from
    Workbook 2 and formats them as a receipt. I have 10 products on
    Workbook 2, each with a different name and a different price.

    What I need for Workbook 1, is a way to:

    1. detect when I have a value other than "0" in the quantity cell on
    Workbook 2
    2. If the quantity is >0, enter the quantity into a cell in Workbook 1
    3. multiply the cell value that is the quantity by a designated price;
    the price of the product.


    How do I accomplish this?

    Thanks.


  2. #2
    Ragdyer
    Guest

    Re: if statement needed

    Assume qunatity is B2 on Sheet2,
    Assume price is in C2 on Sheet2:

    =IF(AND(Sheet2!B2<>0,Sheet2!C2<>0),Sheet2!B2*Sheet2!C2,"Need Data")

    --
    HTH,

    RD

    ---------------------------------------------------------------------------
    Please keep all correspondence within the NewsGroup, so all may benefit !
    ---------------------------------------------------------------------------
    <lrbtav@gmail.com> wrote in message
    news:1154626397.162573.327490@75g2000cwc.googlegroups.com...
    > Here is my scenario:
    >
    > I have two workbooks in one xls file. Workbook 1 takes values from
    > Workbook 2 and formats them as a receipt. I have 10 products on
    > Workbook 2, each with a different name and a different price.
    >
    > What I need for Workbook 1, is a way to:
    >
    > 1. detect when I have a value other than "0" in the quantity cell on
    > Workbook 2
    > 2. If the quantity is >0, enter the quantity into a cell in Workbook 1
    > 3. multiply the cell value that is the quantity by a designated price;
    > the price of the product.
    >
    >
    > How do I accomplish this?
    >
    > Thanks.
    >



  3. #3
    lrbtav@gmail.com
    Guest

    Re: if statement needed

    Ragdyer ,

    Thank you, that helps me out.

    Another question: Let's say I have a 'quantity' column in Sheet2. I'm
    looking at cell B2, which has a value of 3.

    Is it possible, in Sheet1, to display the text "Red" in a certain cell
    if the value of B2 in Sheet2 is greater than 0 (in this case; 3)?

    Thanks again.

    Ragdyer wrote:
    > Assume qunatity is B2 on Sheet2,
    > Assume price is in C2 on Sheet2:
    >
    > =IF(AND(Sheet2!B2<>0,Sheet2!C2<>0),Sheet2!B2*Sheet2!C2,"Need Data")
    >
    > --
    > HTH,
    >
    > RD
    >
    > ---------------------------------------------------------------------------
    > Please keep all correspondence within the NewsGroup, so all may benefit !
    > ---------------------------------------------------------------------------
    > <lrbtav@gmail.com> wrote in message
    > news:1154626397.162573.327490@75g2000cwc.googlegroups.com...
    > > Here is my scenario:
    > >
    > > I have two workbooks in one xls file. Workbook 1 takes values from
    > > Workbook 2 and formats them as a receipt. I have 10 products on
    > > Workbook 2, each with a different name and a different price.
    > >
    > > What I need for Workbook 1, is a way to:
    > >
    > > 1. detect when I have a value other than "0" in the quantity cell on
    > > Workbook 2
    > > 2. If the quantity is >0, enter the quantity into a cell in Workbook 1
    > > 3. multiply the cell value that is the quantity by a designated price;
    > > the price of the product.
    > >
    > >
    > > How do I accomplish this?
    > >
    > > Thanks.
    > >



  4. #4
    lrbtav@gmail.com
    Guest

    Re: if statement needed

    To clarify:

    I have 42 different products, I only want those who have a quantity
    greater than 1 to show up on the receipt sheet.

    Hopefully this makes more sense; Thanks!


  5. #5
    Ragdyer
    Guest

    Re: if statement needed

    You've now asked 2 different questions.

    What happens if you take this formula and copy it down a column on Sheet1?

    Does that do what you want?

    Assume product name is in Column A of Sheet2:

    =IF(Sheet2!B2>1,Sheet2!A2,"")

    --
    HTH,

    RD

    ---------------------------------------------------------------------------
    Please keep all correspondence within the NewsGroup, so all may benefit !
    ---------------------------------------------------------------------------


    <lrbtav@gmail.com> wrote in message
    news:1154629722.127425.313060@b28g2000cwb.googlegroups.com...
    > To clarify:
    >
    > I have 42 different products, I only want those who have a quantity
    > greater than 1 to show up on the receipt sheet.
    >
    > Hopefully this makes more sense; Thanks!
    >



  6. #6
    lrbtav@gmail.com
    Guest

    Re: if statement needed

    Sorry for the confusion. If I post your formula into Sheet1, it does
    what it should; checks the value of the cell, and if greater than one,
    it auto fills.

    I have another question, now that we have that resolved.

    Sheet1 has this function: =Sheet2!$J$2 - what this does, is allows me
    to enter a 'row number' from Sheet2, which directs all other
    functionson Sheet1 such as " =INDIRECT("Sheet2!AC" &RowIndex) " to use
    all values in the corresponding row.

    Problem: This series of formula works for my phone/fax number, but how
    do I integrate it with your product/quantity formula?

    (IE: I enter a row number, it pulls up the customer information as well
    as their order quantities, currently, the order quantities stay the
    same because the formula doesn't know which row to look in)

    Thank you SO MUCH for your help!


    Ragdyer wrote:
    > You've now asked 2 different questions.
    >
    > What happens if you take this formula and copy it down a column on Sheet1?
    >
    > Does that do what you want?
    >
    > Assume product name is in Column A of Sheet2:
    >
    > =IF(Sheet2!B2>1,Sheet2!A2,"")
    >
    > --
    > HTH,
    >
    > RD
    >
    > ---------------------------------------------------------------------------
    > Please keep all correspondence within the NewsGroup, so all may benefit !
    > ---------------------------------------------------------------------------
    >
    >
    > <lrbtav@gmail.com> wrote in message
    > news:1154629722.127425.313060@b28g2000cwb.googlegroups.com...
    > > To clarify:
    > >
    > > I have 42 different products, I only want those who have a quantity
    > > greater than 1 to show up on the receipt sheet.
    > >
    > > Hopefully this makes more sense; Thanks!
    > >



  7. #7
    Forum Contributor
    Join Date
    07-05-2006
    Location
    Canada
    MS-Off Ver
    2003, 2007
    Posts
    581
    Quote Originally Posted by lrbtav@gmail.com
    Here is my scenario:

    I have two workbooks in one xls file. Workbook 1 takes values from
    Workbook 2 and formats them as a receipt. I have 10 products on
    Workbook 2, each with a different name and a different price.

    What I need for Workbook 1, is a way to:

    1. detect when I have a value other than "0" in the quantity cell on
    Workbook 2
    2. If the quantity is >0, enter the quantity into a cell in Workbook 1
    3. multiply the cell value that is the quantity by a designated price;
    the price of the product.


    How do I accomplish this?

    Thanks.
    Do you mean Two Worksheets in the same .xls file? Assuming this is what you mean:

    1. Should probably combine with #2.
    2. In the cell in Workbook 1, put the formula =IF('Workbook 2'!A1>0,'Workbook 2'!A1,""). (Change A1 to wherever it is in Workbook 2)
    3. In the cell in Workbook 1, you can put =IF('Workbook 2'!A1>0,'Workbook 2'!A1 * 'Workbook 2'!B1, ""). (Change A1 to wherever the quantity is in Workbook 2, and the B1 to wherever the price is in Workbook 2.)

    Scott

+ 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