Time-Defined IF Statement Executed in Excel - excel

I have a formula that I've been trying to setup to read a data value from the 4th row of a column IF the current time is less than a certain value, ELSE pull from the 2nd row of the column.
=IF($Z$16<5,'SOME TEXT'!N4,'SOME TEXT'!N2)
Formula for Current Time (Hour) in Cell $Z$16:
=TEXT(NOW(),"H")
The purpose of this IF statement is to account for using old temperature data until 5am, when the new data comes in. I thought that I had this formula set up but, for the past few mornings, it has not worked.

Use
=IF(<time-of-the-day><TIME(5,0,0),'SOME TEXT'!N4,'SOME TEXT'!N2)
You would replace <time-of-the-day> by any of
(NOW()-TODAY())
(NOW()-INT(NOW()))
TIME(HOUR(NOW()),MINUTE(NOW()),SECOND(NOW()))
TIMEVALUE(TEXT(NOW(),"H:M:S"))
There might be better options to isolate the current time of the day.

Related

Replacement for HLOOKUP formula to find most recent entry with additional criteria in unsorted data?

I need to find a formula to replace the current HLOOKUP in the "Individual Report" tab under the "Recurring" column (F5:F92) to identify the MAX Date in the "Recurring" Assessment Type per "SENTRI ID" and return those values.
The data is NOT pre-sorted by date, so it's returning the first "Recurring" value not necessarily the MAX "Recurring" value.
Excel sheet with dummy data: Example
------------------------------------------
I added a Pivot Table to find the MAX value per ID, then tried to update the string in F3, but perhaps because it became one long string of numbers versus "###Recurring", it doesn't return anything...?
**ETA: Using =XLOOKUP(MAXIFS(CANS_Date,SENTRI_ID,$B$2),CANS_Date,CANS_Date,"")
will return the MAX date, but not the MAX "Recurring" Date.
I'm not sure what formula to use to return the text-based values (i.e. Staff Name, Consumer Name, Assessment Type).**
------------------------------------------
Additional notes:
There are too many items to use a form for entry (88)
The staff who enter the data are NOT tech savvy enough to change their default enter-to-down to enter-to-right
Here are the potential alternative solutions I've thought through but am hoping I will not have to resort to:
Resort the data manually and then every time new data is entered
Add an additional "Assessment" type called "Most Recent" and update previously entered data as needed manually every time new data is entered
Rebuild the "Data" tab to enter by row and not column and face the wrath of the staff for the increased entry time
For my purposes, this is what I ended up doing:
For the MAX date in F9, I'm rolling with the MAX and not just the MAX of "Recurring". It's not ideal but it'll work.
=XLOOKUP(MAXIFS(CANS_Date,SENTRI_ID,$B$2),CANS_Date,CANS_Date,"")
For cells F10:F92, I used FILTER to grab the right scores:
=FILTER(Data!D7:ZZ7,(Data!$D$4:$ZZ$4='Individual Report'!$B$2)*(Data!$D$6:$ZZ$6='Individual Report'!$F$9),"missing")

Auto populate a table based from datas from another table

this is the another version of my first question and I hope I can best explain my problem this time.
From the Table 1, I want to auto populate Table 2 based on this conditions and criteria (below)
From the example, I basically have 3 initial criteria, ON CALL, AVAILABLE, and BREAK
Now for the conditions, I want all Agents from status ON CALL, AVAILABLE, BREAK from Table 1 to be populated on Table 2 (optional: If possible, I wanted only to show agents that HAS a duration of 4 minutes and above from each status). My problem is I always refresh TABLE 1 so I can get an updated data. My goal here is to monitor our agents their current Status and Running Duration, and from that I only need to check on the table 2 so I would see right away who has the highest running duration from each status to be called out.
I only tried MAXIFS function but my problem with it, I can only show 1 result from each status.
What I wanted is to fully populate Table 2 from the data on Table 1. If this is possible with ROW function that would be great, because what I really wanted is a clean Table, and it should only load data if the criteria is met.
Thank you
Something you may be interested in doing is utilizing HSTACK. I am not sure how you are currently obtaining the Agents name in the adjacent column to the results but this would populate both the Agent along with the Duration.
=HSTACK(INDEX(A:C,MATCH(SORT(FILTER(C:C,(C:C>=TIMEVALUE("00:04:00"))*(B:B=H2),""),1,1),C:C,0),1),TEXT(SORT(FILTER(C:C,(C:C>=TIMEVALUE("00:04:00"))*(B:B=H2),""),1,1),"[h]:mm:ss"))
This formula checks Table 1 for any Agent with the status referenced in H2 (Available) that also has a time greater than or equal to 4 mins. It then sorts the results in ascending order and populates the Agent Name that is associated with it. It is dynamic and will produce a table like the following:
Just update the formula to check for "On Call" and "BreaK" as desired for the other two.
UPDATE:
As for conditional formatting, this is utilizing the custom formula posted in the comments. If the formatting of the times are of [h]:mm:ss then you would be looking to do something like this. Notice the 2 cells are highlighted for being between 4 mins and 5 mins.
This is an array solution that spill all the results at once. We use a user LAMBDA function GET to avoid repetition of the same calculation using as input parameter the status (s). The formula works for durations in time format or in text format with a minor modification. On cell E2 put the following formula for durations in time format:
=LET(GET, LAMBDA(s, FILTER(HSTACK(A:A, C:C), (B:B=s)
* IFERROR(C:C >= TIME(0,4,0), FALSE))),
IFERROR(HSTACK(GET("ON CALL"), GET("Available"), GET("Break")),""))
Here is the output:
For durations as text in hh:mm:ss format just replace: C:C >= TIME(0,4,0) with TIMEVALUE(C:C) >= TIME(0,4,0).
The GET function is reused to generate the result for each status. The last IFERROR call is used to remove #N/A values generated by HSTACK when the column doesn't have the maximum number of rows of the output.
The first IFERROR is used to treat the case when the value is not numeric, such has the header. This is because we are using the entire column as input range. Using entire columns produce more concise formulas with less maintenance effort, but it is less efficient, unless you have a good reason to have an open range. If you want to use a specific range instead for the data of the table, then you can remove it and update the ranges accordingly.

Excel Help - using IF and WORKDAY functions to generate a due date

I am trying to forumlate an IF statement that will generate a due date by taking a given date and adding business days to that dependent on a value in a separate column.
I started off with:
=IF(E3="Fatal",D3+1,IF(E3="Life Threatening",D3+1,IF(E3="Non-Fatal",D3+3,IF(E2="Non-Life Threatening",D3+3,IF(E3="Non-Susar",D3+5,"")))))
But this does not use the WORKDAY or WORKDAY.INT functions at all and is something I am now needing to add. I have collated a list of bank holidays to add into the new function these are listed - 'Backend Sheet (No Edit)'!C1:C752
Example of the sheet is below, I basically need to have it add 1,3,5 business days to the "query received date" dependent on the value in the "seriousness" column and print the new date into the "first attempt due by date" column
Appreciate any help that can be given!
Put your seriousness in a separate helper table along with the days adjustment. Then use workday to find your attempt date.
=workday([date received], index([helper table adjustment],match([this table seriousness],[helper table seriousness],0)),'Backend Sheet (No Edit)'!C1:C752)

EXCEL Time Field

Time 13:15:09 Batch 09:00 to 18:00
I have to compare if Column1(Time) is between the time mentioned in Column2(Batch)
This can also be accomplished using MEDIAN function in Excel.
Try the following formula:
=TIMEVALUE(RIGHT(A1,8))=MEDIAN(RIGHT(A1,8),MID(B1,7,5),RIGHT(B1,5))
And to be on safer side you can use TIMEVALUE for all the values used in formula as:
=TIMEVALUE(RIGHT(A1,8))=MEDIAN(TIMEVALUE(RIGHT(A1,8)),TIMEVALUE(MID(B1,7,5)),TIMEVALUE(RIGHT(B1,5)))
we will assume your data is all in a string and the format of the string does not change. We will pull out the time through some string manipulations and counting and use the timevalue function in the end.
Let assume for now that we are pulling the column A time out and placing it in column B. This is a temporary step and will disappear when all combined in one cell at the end. Since we know the time is the last 8 characters we can use the following:
=Timevalue(Right(A1,8))
Now let pull the first time in column B. Lets us a left right string strip combination to pull the time. We could also use mid. The first formula would look like:
=timevalue(right(left(B1,11),5))
or
=timevalue(MID(B1,7,5))
To pull out the second time the easiest approach would be a reapeat of what we did for the first time we pulled out and use the RIGHT formula:
=timevalue(right(B1,5))
Now you could put all those in separate columns to ensure they are working and assist you will building your final equation. With all that in one cell, you final equation would look something like.
=if(AND(Timevalue(Right(A1,8))<=timevalue(right(B1,5)),Timevalue(Right(A1,8))>=timevalue(MID(B1,7,5))),"Time is within batch time","Time outside batchtime")

Error in Calculated Column (using Today) in DataSheet View - Sharepoint 2010

I have calulated column which display's the value based on the difference between today and requested date field.
=Today-[Requested Date]
This is working fine in Sharepoint Standard View. But the same is not working with the datasheet view . The calculated column is showing as below
=#NAME?-[Requested Date].
Due to this i am not able to save the data. Can anyone please let me know how to solve this ?
Which SharePoint version are you using?
I tried the same scenario using SharePoint 2013 and was able to add the values in both standard and datasheet views. I am assuming you might have used the same steps.
Create 2 new columns named RequestedDate(DateTime) and
Today(Single line of text).
Add a new column of type calculated field with formula
=Today-[Requested Date].
Now delete the Today column.
Try entering the data in both the views.
First I have used today() function to calculate difference between 2 days except working days. The list is not automatically updating. If we change the Start_Date, then it calculates and gives the value. Can you suggest me why this happens?
You have mentioned in your post that there is some tricks in using today() function. I have created separate Today_Date column in my list. And Used the same column name in finding difference between 2 days. Here also the same problem exists.
The formula I used is,
=IF(AND((WEEKDAY([Today Date],2))<(WEEKDAY([Release Date],2)),((WEEKDAY([Release Date],2))-(WEEKDAY([Today Date],2)))>1),(((DATEDIF([Release Date],[Today Date],"D")+1))-(FLOOR((DATEDIF([Release Date],[Today Date],"D")+1)/7,1)*2)-2),(((DATEDIF([Release Date],[Today Date],"D")+1))-(FLOOR((DATEDIF([Release Date],[Today Date],"D")+1)/7,1)*2)))
Please tell me how to make the difference between 2 date values update automatically every time I open the list.
Then I tried the trick which you have mentioned above. But it works while I enter the data. When I open the list for the next day or some other day's after the Calculated column is not taking the current day's value, do the data remains same. what should I need to do in case it needs to take current date's value and calculate the formula?

Resources