Google Sheets: how to find number of consecutive missed meetings - date

I want to track the number of consecutive meetings that a person has missed.
I've got one column with names and a second column with the last meeting they attended. I've then got a separate column with an ordered list of meeting dates (they're not regular).
I want a formula that checks the last meeting attended against the list of meeting dates, and outputs the number of meetings that have occurred since.
I've no idea how to approach this. Can anyone offer a formula - or even a place to start?

I've solved it!
The full formula is a bit of a muddled mess, but it does four things:
finds total number of meetings (using COUNTA)
finds the location of the last meeting in the list of meetings (using MATCH)
uses the previous two values to find the range containing all the missed meetings (using CONCATENATE)
counts the number of meetings in this range (using COUNTA)

Related

Trying to come up with a formula that would return different greetings given per cell based on a list of greetings

I have created a daily journal in Spreadsheets where each day has it's own section. In each section, I created a questionaire that asks the user how they are doing in that day. I would like to add on top of that questionaire a different greeting per day, so I wrote a list with 30 variations in each cell (for example: "hello", "good morning", "buenos dias", "bon jour"...).
Where the different greetings will show up
list of greetings
I tried to use the rand() formula to select different greetings but since that formula is volatile and updates every time I make a change, it wont work for me.
As a solution, Each daily section starts with a cell countaining the date, so I thought that since each day would have a different greeting, I could use the number value of each date to drive the selection (for example: 05/05/2022 is the number value 44686, the next day is 44687).
I thought about using the Index formula but it requires that I use a number from 1 to 30 to retrieve one of those 30 greetings. I think that even if I were to somehow transform the date into a number from 1 to 30, perhaps in a few days, the value would end up being bigger than 30.
Anyway, I appreciate any help!
Gabriel

Finding rows with matching id's and the using the date fields in each row to find the time difference in days between them

I have rows of data where up to 3 id's match. I need to try and find the number of days between each of the rows with matching id's using the date field. I am looking to find the number of days between each row in date sequence. So between the first and second row in date sequence, or second and third row but not the first and third row.
So a simplified version of my rows can be seen in the attached image.
image showing 2 ID's with multiple entries. John Smith (highlight yellow) who has 3 entries, two on the same day and one later and Bill Wright who has just two entries on separate days.
The results I would be looking for would ideally be shown in column 4 of the image.
Is there any way I can do this in a formula or pivot table? (basically avoiding VBA) Any suggestions hugely appreciated! Thanks.
This array formula
=IFERROR(B2-INDEX($B$1:$B$9,MAX((A2=$A$1:A1)*ROW($A$1:A1))),0)
will work as long as your data are sorted by date (which your screenshot indicates they are):

Extracting most recent record in REPORT SELECTION FORMULAS GROUP. Crystal 13

I am extracting information on medication requests. For each medication request, say in the last 90 minutes, I also want to display a date for any previous time a drug was dispensed for the same patient. In many cases there will be no such history as its the first time the patient has had this drug.
I cannot seem to both show the most recent dates for those patient/drug combinations where there is a prior date but keep the records where there is no history of a prior drug being dispensed.
I have utilised Report, Selection Formulas Group as has worked in the past with different queries.
{#DispenseDT}=MAXIMUM({#DispenseDT},{#RefDRUGPATID})
NB DispenseDT is a formula joining Dispensed Date and Dispensed Time
NB RefDRUGPATID creates a unique reference for each Drug and Patient combination.
This appears to work in pulling through the most recent dispensed date/time for each DRUG/PATIENT combination. If I don't do this I get the first (oldest) record.
However, when I apply this I also lose records. I think this is because not all the DRUG/PATIENT combinations being requested have had previous records so when the formula cant find a MAXIMUM it excludes the record entirely.
I have tried doing something like if isnull({#DispenseDT}then " " else
ToText({#DispenseDT}=MAXIMUM({#DispenseDT},{#RefDRUGPATID})) but when I try and create a formula and display this I just seem to get either BLANKS or TRUE or FALSE displayed, not the "MAXIMUM" DispenseDT. It doesn't like me putting the formula within SELECTION FORMULAS GROUP either.
So in summary I am looking to pull the most recent historical dispensing date for a patient/drug combination for each new request made. But where there is no history of a drug being dispensed I still need to see the new dispensing request record.
I am using crystal reports 13.

Crystal reports crosstabs column grouping

I'm trying to build a cross tab report in Crystal XI that has dates, grouped by the month as column heading, and have 2 questions I'm trying to find answers to.
1: Is there any way to display a month even if there are no records to be summarized in that month? i.e. no orders for March, but want to display Jan, Feb, Mar.? I'm pretty sure I can create a dates table and use that spoof it, but don't want to go that route as the database is part of a Vendor's package and I don't want to get to crazy in there.
2: Is there a way of specifying or limiting how many columns go across? For example in a forecast cross tab I only owant current month and the next six months to show up. I suppose I can do a date range on the selection criteria, but that seems a bit kludgy to me.
Thanks for any answers
Short answer: No.
I've seen discussions about workarounds involving creation of temporary tables, but I've never tried any such solutions myself.
I would go with the date range on the selection criteria. You could make those dates parameters for more convenient useage. If you have sevral cross-tabs that should have different date ranges you could put the crosstabs in sub-reports.

Crystal reports - Group total

I have a report that I've written and I understand how to create running totals and such, but need help creating a custom evaluation formula.
I have two levels of groups, first group is based upon a certain user, the next group is based upon transactions that user has been involved in. I have details hidden, and am only interested in the totals for a particular activity. This is working great, and totals are working properly but the problem is, each activity has a 'line number', which essentially can be the same as another activity (ie: two activities can have lines 1, 2, 3 contained within), so doing a distinctive total based upon a set of data isn't accurate because I only want it to be distinct based upon each individual recordset, and not globally.
The example is below... if I do a count on each record for this dataset, it comes out to 18 because there are duplicate line numbers on each... but if I do distinct, it only comes to 9 because of duplicate line numbers across multiple actives.
I guess what I need to know is how I can take the totals per detail group, and have them total up in my second footer properly. I assume it's going to take me compiling together a string including the activity number and line number, and then comparing them?
Here is an example of the data contained within the total groupings:
I figured this out on my own... turned out it was pretty simple. I converted my numeric values to text, and included a copy of the transaction id and the line id as my test value, and did distinct on that... Sometimes it just helps not staring the problem down.