+ Reply to Thread
Results 1 to 10 of 10

Need Formula To Find Data

  1. #1
    Monte Sliger
    Guest

    Need Formula To Find Data

    I am using Excel 2000.

    I need a formula to find particular data within an array of data. I have a
    worksheet displaying inventory activity. Cell A1 is a cutoff date. Cells
    A4 thru A1000 are the dates of the activity. Cells B4 thru B1000 are
    descriptions. Cells C4 thru C1000 are additions. Cells D4 thru D1000 are
    subtractions. Each row will have a date, description and either an addition
    or subtraction amount (but not both on the same row).

    I need a formula to return the date, description and adddition amount of the
    last row with an amount in the additions field where the date is on or
    before the cutoff date.

    Any help you can give me will be greatly appreciated.


    Thanks,
    Monte Sliger



  2. #2
    Don Guillett
    Guest

    Re: Need Formula To Find Data

    You can use the MATCH function to find the row in col A and then incorporate
    that as the row in the INDEX function to include all columns.

    --
    Don Guillett
    SalesAid Software
    dguillett1@austin.rr.com
    "Monte Sliger" <msliger1@cox.net> wrote in message
    news:e4$cSJGTGHA.4792@TK2MSFTNGP14.phx.gbl...
    >I am using Excel 2000.
    >
    > I need a formula to find particular data within an array of data. I have
    > a worksheet displaying inventory activity. Cell A1 is a cutoff date.
    > Cells A4 thru A1000 are the dates of the activity. Cells B4 thru B1000
    > are descriptions. Cells C4 thru C1000 are additions. Cells D4 thru D1000
    > are subtractions. Each row will have a date, description and either an
    > addition or subtraction amount (but not both on the same row).
    >
    > I need a formula to return the date, description and adddition amount of
    > the last row with an amount in the additions field where the date is on or
    > before the cutoff date.
    >
    > Any help you can give me will be greatly appreciated.
    >
    >
    > Thanks,
    > Monte Sliger
    >
    >




  3. #3
    Don Guillett
    Guest

    Re: Need Formula To Find Data

    You can use the MATCH function to find the row in col A and then incorporate
    that as the row in the INDEX function to include all columns.

    --
    Don Guillett
    SalesAid Software
    dguillett1@austin.rr.com
    "Monte Sliger" <msliger1@cox.net> wrote in message
    news:e4$cSJGTGHA.4792@TK2MSFTNGP14.phx.gbl...
    >I am using Excel 2000.
    >
    > I need a formula to find particular data within an array of data. I have
    > a worksheet displaying inventory activity. Cell A1 is a cutoff date.
    > Cells A4 thru A1000 are the dates of the activity. Cells B4 thru B1000
    > are descriptions. Cells C4 thru C1000 are additions. Cells D4 thru D1000
    > are subtractions. Each row will have a date, description and either an
    > addition or subtraction amount (but not both on the same row).
    >
    > I need a formula to return the date, description and adddition amount of
    > the last row with an amount in the additions field where the date is on or
    > before the cutoff date.
    >
    > Any help you can give me will be greatly appreciated.
    >
    >
    > Thanks,
    > Monte Sliger
    >
    >




  4. #4
    Registered User
    Join Date
    03-17-2006
    Posts
    47

    Vlookup formula

    You could try this formula
    =VLOOKUP(A1,A4:D1000,2) in B1. This first looks up the date in cell A1 - say the answer is 21 March. It then finds the latest 21 March (or 20 March if there is no 21 March) in the table below and shows what is in column 2 (Description) for that date. Use ,3 for looking up additions, and ,4 for subtractions.
    Clive

  5. #5
    Monte Sliger
    Guest

    Re: Need Formula To Find Data

    Clive,

    Unfortunately, that doesn't work because it returns data from the last row
    before the cutoff date regardless of whether there is a value in the
    addtions field or not. I need the data from the last row which is both
    before the cutoff date and has an amount in the additions column. This row
    may be the last row in the worksheet or any row above it.

    Lets suppose I have three rows in the worksheet (all befre the cutoff date)
    with row 1 being a row with a number in the additions field and rows 2 and 3
    having numbers in the subtractions field. I need to return the data from
    row 1 not rows 2 or 3.


    Thank you for trying to help me.
    Monte Sliger


    "Clivey_UK" <Clivey_UK.250zvm_1142954700.7676@excelforum-nospam.com> wrote
    in message news:Clivey_UK.250zvm_1142954700.7676@excelforum-nospam.com...
    >
    > You could try this formula
    > =VLOOKUP(A1,A4:D1000,2) in B1. This first looks up the date in cell A1
    > - say the answer is 21 March. It then finds the latest 21 March (or 20
    > March if there is no 21 March) in the table below and shows what is in
    > column 2 (Description) for that date. Use ,3 for looking up additions,
    > and ,4 for subtractions.
    > Clive
    >
    >
    > --
    > Clivey_UK
    > ------------------------------------------------------------------------
    > Clivey_UK's Profile:
    > http://www.excelforum.com/member.php...o&userid=32569
    > View this thread: http://www.excelforum.com/showthread...hreadid=524559
    >




  6. #6
    Monte Sliger
    Guest

    Re: Need Formula To Find Data

    Don,

    I think this may be the answer but in looking at those formulas I am
    confused as to how to incorporate this into one formula. Could you provide
    a simple example or point me to where I could find one?


    Thanks for your help.
    Monte Sliger


    "Don Guillett" <dguillett1@austin.rr.com> wrote in message
    news:%23zlBcVPTGHA.5468@TK2MSFTNGP14.phx.gbl...
    > You can use the MATCH function to find the row in col A and then
    > incorporate that as the row in the INDEX function to include all columns.
    >
    > --
    > Don Guillett
    > SalesAid Software
    > dguillett1@austin.rr.com
    > "Monte Sliger" <msliger1@cox.net> wrote in message
    > news:e4$cSJGTGHA.4792@TK2MSFTNGP14.phx.gbl...
    >>I am using Excel 2000.
    >>
    >> I need a formula to find particular data within an array of data. I have
    >> a worksheet displaying inventory activity. Cell A1 is a cutoff date.
    >> Cells A4 thru A1000 are the dates of the activity. Cells B4 thru B1000
    >> are descriptions. Cells C4 thru C1000 are additions. Cells D4 thru
    >> D1000 are subtractions. Each row will have a date, description and
    >> either an addition or subtraction amount (but not both on the same row).
    >>
    >> I need a formula to return the date, description and adddition amount of
    >> the last row with an amount in the additions field where the date is on
    >> or before the cutoff date.
    >>
    >> Any help you can give me will be greatly appreciated.
    >>
    >>
    >> Thanks,
    >> Monte Sliger
    >>
    >>

    >
    >




  7. #7
    Don Guillett
    Guest

    Re: Need Formula To Find Data

    try re-reading my post where you look in the help index for the MATCH
    function to find the row and then the index function using the match formula
    in place of the row. Have you looked in the HELP index?


    --
    Don Guillett
    SalesAid Software
    dguillett1@austin.rr.com
    "Monte Sliger" <msliger1@cox.net> wrote in message
    news:%23SxGpAQTGHA.5500@TK2MSFTNGP12.phx.gbl...
    > Don,
    >
    > I think this may be the answer but in looking at those formulas I am
    > confused as to how to incorporate this into one formula. Could you
    > provide a simple example or point me to where I could find one?
    >
    >
    > Thanks for your help.
    > Monte Sliger
    >
    >
    > "Don Guillett" <dguillett1@austin.rr.com> wrote in message
    > news:%23zlBcVPTGHA.5468@TK2MSFTNGP14.phx.gbl...
    >> You can use the MATCH function to find the row in col A and then
    >> incorporate that as the row in the INDEX function to include all columns.
    >>
    >> --
    >> Don Guillett
    >> SalesAid Software
    >> dguillett1@austin.rr.com
    >> "Monte Sliger" <msliger1@cox.net> wrote in message
    >> news:e4$cSJGTGHA.4792@TK2MSFTNGP14.phx.gbl...
    >>>I am using Excel 2000.
    >>>
    >>> I need a formula to find particular data within an array of data. I
    >>> have a worksheet displaying inventory activity. Cell A1 is a cutoff
    >>> date. Cells A4 thru A1000 are the dates of the activity. Cells B4 thru
    >>> B1000 are descriptions. Cells C4 thru C1000 are additions. Cells D4
    >>> thru D1000 are subtractions. Each row will have a date, description and
    >>> either an addition or subtraction amount (but not both on the same row).
    >>>
    >>> I need a formula to return the date, description and adddition amount of
    >>> the last row with an amount in the additions field where the date is on
    >>> or before the cutoff date.
    >>>
    >>> Any help you can give me will be greatly appreciated.
    >>>
    >>>
    >>> Thanks,
    >>> Monte Sliger
    >>>
    >>>

    >>
    >>

    >
    >




  8. #8
    Monte Sliger
    Guest

    Re: Need Formula To Find Data

    Don,

    Yes I did look in the help index. I can return the value of the last row
    where the date is less than or equal to the cutoff date (MATCH(A1,A4:A100,1)
    and I can return the value of the last row where the additions amount is
    less than or equal to a number (MATCH(100,C4:C100,1) but I cannot figure out
    how to put these two formulas together. I tried
    (MATCH(A1,A4:A100,1)*MATCH(100,C4:C100,1)) but this does not return the
    correct value.

    Sorry if I sound dumb, but I cannot figure out how to put two match formulas
    together to return the value of a unique row where the date is less than or
    equal to A1 and the additions amount is GREATER than 0. Match always
    returns the largest value that is less than or equal to lookup value or the
    smallest value greater than or equal to lookup value depending on the match
    type you select. I need the largest value (row) that is greater than 0 or
    else the largest value (row) that is not blank if that is an easier way to
    look at it.


    Again I appreciate all your help.
    Monte Sliger


    "Don Guillett" <dguillett1@austin.rr.com> wrote in message
    news:ecZjqVQTGHA.736@TK2MSFTNGP12.phx.gbl...
    > try re-reading my post where you look in the help index for the MATCH
    > function to find the row and then the index function using the match
    > formula in place of the row. Have you looked in the HELP index?
    >
    >
    > --
    > Don Guillett
    > SalesAid Software
    > dguillett1@austin.rr.com
    > "Monte Sliger" <msliger1@cox.net> wrote in message
    > news:%23SxGpAQTGHA.5500@TK2MSFTNGP12.phx.gbl...
    >> Don,
    >>
    >> I think this may be the answer but in looking at those formulas I am
    >> confused as to how to incorporate this into one formula. Could you
    >> provide a simple example or point me to where I could find one?
    >>
    >>
    >> Thanks for your help.
    >> Monte Sliger
    >>
    >>
    >> "Don Guillett" <dguillett1@austin.rr.com> wrote in message
    >> news:%23zlBcVPTGHA.5468@TK2MSFTNGP14.phx.gbl...
    >>> You can use the MATCH function to find the row in col A and then
    >>> incorporate that as the row in the INDEX function to include all
    >>> columns.
    >>>
    >>> --
    >>> Don Guillett
    >>> SalesAid Software
    >>> dguillett1@austin.rr.com
    >>> "Monte Sliger" <msliger1@cox.net> wrote in message
    >>> news:e4$cSJGTGHA.4792@TK2MSFTNGP14.phx.gbl...
    >>>>I am using Excel 2000.
    >>>>
    >>>> I need a formula to find particular data within an array of data. I
    >>>> have a worksheet displaying inventory activity. Cell A1 is a cutoff
    >>>> date. Cells A4 thru A1000 are the dates of the activity. Cells B4 thru
    >>>> B1000 are descriptions. Cells C4 thru C1000 are additions. Cells D4
    >>>> thru D1000 are subtractions. Each row will have a date, description
    >>>> and either an addition or subtraction amount (but not both on the same
    >>>> row).
    >>>>
    >>>> I need a formula to return the date, description and adddition amount
    >>>> of the last row with an amount in the additions field where the date is
    >>>> on or before the cutoff date.
    >>>>
    >>>> Any help you can give me will be greatly appreciated.
    >>>>
    >>>>
    >>>> Thanks,
    >>>> Monte Sliger
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >




  9. #9
    Don Guillett
    Guest

    Re: Need Formula To Find Data

    From the help index for INDEX. Here is where you use the match formula for
    the ROW part of the index formula.
    INDEX
    See Also

    Returns the reference of the cell at the intersection of a particular row
    and column. If the reference is made up of nonadjacent selections, you can
    pick the selection to look in.

    The INDEX function has two syntax forms: array and reference. The array form
    always returns a value or an array of values; the reference form always
    returns a reference.

    Syntax 2

    Reference form

    INDEX(reference,row_num,column_num,area_num)

    Reference is a reference to one or more cell ranges.

    a.. If you are entering a nonadjacent range for the reference, enclose
    reference in parentheses.

    b.. If each area in reference contains only one row or column, the row_num
    or column_num argument, respectively, is optional. For example, for a single
    row reference, use INDEX(reference,,column_num).

    Row_num is the number of the row in reference from which to return a
    reference.

    Column_num is the number of the column in reference from which to return a
    reference.

    Area_num selects a range in reference from which to return the
    intersection of row_num and column_num. The first area selected or entered
    is numbered 1, the second is 2, and so on. If area_num is omitted, INDEX
    uses area 1.

    a.. For example, if reference describes the cells (A1:B4,D1:E4,G1:H4),
    then area_num 1 is the range A1:B4, area_num 2 is the range D1:E4, and
    area_num 3 is the range G1:H4.

    Remarks

    a.. After reference and area_num have selected a particular range, row_num
    and column_num select a particular cell: row_num 1 is the first row in the
    range, column_num 1 is the first column, and so on. The reference returned
    by INDEX is the intersection of row_num and column_num.
    b.. If you set row_num or column_num to 0 (zero), INDEX returns the
    reference for the entire column or row, respectively.

    c.. Row_num, column_num, and area_num must point to a cell within
    reference; otherwise, INDEX returns the #REF! error value. If row_num and
    column_num are omitted, INDEX returns the area in reference specified by
    area_num.
    d.. The result of the INDEX function is a reference and is interpreted as
    such by other formulas. Depending on the formula, the return value of INDEX
    may be used as a reference or as a value. For example, the formula
    CELL("width",INDEX(A1:B2,1,2)) is equivalent to CELL("width",B1). The CELL
    function uses the return value of INDEX as a cell reference. On the other
    hand, a formula such as 2*INDEX(A1:B2,1,2) translates the return value of
    INDEX into the number in cell B1.
    Example

    The example may be easier to understand if you copy it to a blank worksheet.

    How?

    1.. Create a blank workbook or worksheet.
    2.. Select the example in the Help topic. Do not select the row or column
    headers.


    Selecting an example from Help

    3.. Press CTRL+C.
    4.. In the worksheet, select cell A1, and press CTRL+V.
    5.. To switch between viewing the results and viewing the formulas that
    return the results, press CTRL+` (grave accent), or on the Tools menu, point
    to Formula Auditing, and then click Formula Auditing Mode.


    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    A B C
    Fruit Price Count
    Apples 0.69 40
    Bananas 0.34 38
    Lemons 0.55 15
    Oranges 0.25 25
    Pears 0.59 40

    Almonds 2.80 10
    Cashews 3.55 16
    Peanuts 1.25 20
    Walnuts 1.75 12
    Formula Description (Result)
    =INDEX(A2:C6,2,3) The intersection of the second row and third
    column in the range A2:C6, which is the content of cell C3. (38)
    =INDEX((A1:C6,A8:C11),2,2,2) The intersection of the second row
    and second column in the second area of A8:C11, which is the content of cell
    B9. (3.55)
    =SUM(INDEX(A1:C11,0,3,1)) The sum of the third column in the
    first area of the range A1:C11, which is the sum of C1:C6. (216)
    =SUM(B2:INDEX(A2:C6,5,2)) The sum of the range starting at B2,
    and ending at the intersection of the fifth row and the second column of the
    range A2:A6, which is the sum of B2:B6. (2.42)



    --
    Don Guillett
    SalesAid Software
    dguillett1@austin.rr.com
    "Monte Sliger" <msliger1@cox.net> wrote in message
    news:%23uCAA8QTGHA.5828@TK2MSFTNGP14.phx.gbl...
    > Don,
    >
    > Yes I did look in the help index. I can return the value of the last row
    > where the date is less than or equal to the cutoff date
    > (MATCH(A1,A4:A100,1)
    > and I can return the value of the last row where the additions amount is
    > less than or equal to a number (MATCH(100,C4:C100,1) but I cannot figure
    > out
    > how to put these two formulas together. I tried
    > (MATCH(A1,A4:A100,1)*MATCH(100,C4:C100,1)) but this does not return the
    > correct value.
    >
    > Sorry if I sound dumb, but I cannot figure out how to put two match
    > formulas
    > together to return the value of a unique row where the date is less than
    > or
    > equal to A1 and the additions amount is GREATER than 0. Match always
    > returns the largest value that is less than or equal to lookup value or
    > the
    > smallest value greater than or equal to lookup value depending on the
    > match
    > type you select. I need the largest value (row) that is greater than 0 or
    > else the largest value (row) that is not blank if that is an easier way to
    > look at it.
    >
    >
    > Again I appreciate all your help.
    > Monte Sliger
    >
    >
    > "Don Guillett" <dguillett1@austin.rr.com> wrote in message
    > news:ecZjqVQTGHA.736@TK2MSFTNGP12.phx.gbl...
    >> try re-reading my post where you look in the help index for the MATCH
    >> function to find the row and then the index function using the match
    >> formula in place of the row. Have you looked in the HELP index?
    >>
    >>
    >> --
    >> Don Guillett
    >> SalesAid Software
    >> dguillett1@austin.rr.com
    >> "Monte Sliger" <msliger1@cox.net> wrote in message
    >> news:%23SxGpAQTGHA.5500@TK2MSFTNGP12.phx.gbl...
    >>> Don,
    >>>
    >>> I think this may be the answer but in looking at those formulas I am
    >>> confused as to how to incorporate this into one formula. Could you
    >>> provide a simple example or point me to where I could find one?
    >>>
    >>>
    >>> Thanks for your help.
    >>> Monte Sliger
    >>>
    >>>
    >>> "Don Guillett" <dguillett1@austin.rr.com> wrote in message
    >>> news:%23zlBcVPTGHA.5468@TK2MSFTNGP14.phx.gbl...
    >>>> You can use the MATCH function to find the row in col A and then
    >>>> incorporate that as the row in the INDEX function to include all
    >>>> columns.
    >>>>
    >>>> --
    >>>> Don Guillett
    >>>> SalesAid Software
    >>>> dguillett1@austin.rr.com
    >>>> "Monte Sliger" <msliger1@cox.net> wrote in message
    >>>> news:e4$cSJGTGHA.4792@TK2MSFTNGP14.phx.gbl...
    >>>>>I am using Excel 2000.
    >>>>>
    >>>>> I need a formula to find particular data within an array of data. I
    >>>>> have a worksheet displaying inventory activity. Cell A1 is a cutoff
    >>>>> date. Cells A4 thru A1000 are the dates of the activity. Cells B4
    >>>>> thru
    >>>>> B1000 are descriptions. Cells C4 thru C1000 are additions. Cells D4
    >>>>> thru D1000 are subtractions. Each row will have a date, description
    >>>>> and either an addition or subtraction amount (but not both on the same
    >>>>> row).
    >>>>>
    >>>>> I need a formula to return the date, description and adddition amount
    >>>>> of the last row with an amount in the additions field where the date
    >>>>> is
    >>>>> on or before the cutoff date.
    >>>>>
    >>>>> Any help you can give me will be greatly appreciated.
    >>>>>
    >>>>>
    >>>>> Thanks,
    >>>>> Monte Sliger
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >








  10. #10
    Herbert Seidenberg
    Guest

    Re: Need Formula To Find Data

    Assuming your data looks like this:
    cutoff
    2/2/2006

    date desc add sub
    1/28/2006 A 1
    1/29/2006 B 2
    1/30/2006 C 2
    1/31/2006 D 8
    2/1/2006 E 3
    2/3/2006 F 5
    2/4/2006 G 1
    2/5/2006 H 3
    2/6/2006 I 6
    2/7/2006 J 9

    1/31/2006 D 8

    Name the data with the headers
    (cutoff, date, desc, add, sub) as suggested above.
    Example: Select the 44 cells from <date> to <9> and
    Insert > Name > Create > Top Row
    Also define this name
    Insert > Name > Define
    Names in Workbook > rown
    Refers To > =ROW(INDEX($A:$A,1):INDEX($A:$A,ROWS(date)))
    The 3 output formulas for date, desc and add are respectively
    =INDEX(date,MAX((date<=cutoff)*(add>0)*rown))
    =INDEX(desc,MAX((date<=cutoff)*(add>0)*rown))
    =INDEX(add,MAX((date<=cutoff)*(add>0)*rown))
    Enter these 3 formulas with Cntrl+Shift+Enter instead of just Enter.


+ 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