+ Reply to Thread
Results 1 to 6 of 6

formula logic

  1. #1
    Registered User
    Join Date
    09-30-2008
    Location
    ca
    MS-Off Ver
    excel 2007
    Posts
    19

    formula logic

    My Worksheet contains rows of visits for tests, the result, recall interval for retesting and a cell to indicate if the person returned at the appropriate date. Each person will have multiple entries over time, the records may not be sorted.
    I'm trying to create a formula for the ?Returned cell. It needs to test to see if there is a subsequent visit by that person, and if not flag the row for action. I created a list of unique names, with columns containing the row numbers of the matches, but can't get the logic for the test 'is there a subsequent visit'. Thanks

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    on your master sheet, with (duplicated) names in DA, date of visit in B, interval for Recall in C and "Made recall" in column D.

    In D1 =SUMPRODUCT(--(A2:A100=A1),--(B2:B100<=B1+C1)) will count the number of times that the patient in A1 visited within the retest window (B1+C1). You may want to add a term to the SUMPRODUCT to test if the proper proceedure was performed in that visit(s).
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    09-30-2008
    Location
    ca
    MS-Off Ver
    excel 2007
    Posts
    19

    formula logic

    Thanks,
    I have a column which calculates the total visits for each row,
    =countif(NamedRange,A4)
    where A4 is the beginning of the range, but I can't determine which of the visits any one row is from the total. In other words, the cell ?Returned needs to determine which visit it is, is there another subsequent visit, if so-okay, if not flag it.

  4. #4
    Registered User
    Join Date
    09-30-2008
    Location
    ca
    MS-Off Ver
    excel 2007
    Posts
    19

    formula logic

    Sorry, I misunderstood your formula. When I set this up, I assumed the reference A2:A200 referred to the name column, but this produces a #Value error. What am I doing wrong?
    About the criteria (B2:B100<=B1+C1)) am I right in thinking this counts if the value is anytime before the time B1+C1, not between B1 and B1+C1? Thanks
    Last edited by kysaul; 10-02-2008 at 03:13 PM.

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    If you are testing A2:A200 and B2:B100, there will be an error, since SUMPRODUCT requires the arrays to be the same size.

  6. #6
    Registered User
    Join Date
    09-30-2008
    Location
    ca
    MS-Off Ver
    excel 2007
    Posts
    19

    formula logic

    I solved the problem, the structure of the function that seems to work is
    =sumproduct(($A$1:$A$100=$A1)*(($B$1:$B$100<=$B1+$C1)-
    ($B$1:B$100<$B1+1)))
    which counts the number of visits since the index visit +1 day up 'til the recall time, C1.
    Thanks for your help. being new to this, I didn't know of 'SumProduct'. It seems a usefull function.













    =1

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Formula needed to tell me if a value exists
    By WhatF in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-10-2008, 08:16 AM
  2. How do I subsitute part of a formula linked to another workbook?
    By Scej12 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-03-2007, 10:10 AM
  3. Nested logic? Array formula?
    By Brisbane Rob in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-25-2007, 05:28 AM
  4. formula logic..please help
    By Richard Flame in forum Excel General
    Replies: 3
    Last Post: 01-30-2007, 06:47 PM
  5. logic math formula
    By irishlad in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-01-2006, 10:40 AM

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