Look back through a row and find the last time I wrote a particular word - excel-2007

I have a table that I am creating in relation to toolhire and I have many columns for on hire / off hire / days utilised. in the columns next to the on hire and off hire dates, I have it set to write the words ON and OFF when a date is entered into that cell. I want to set up a column at the end of the table which will look back through the row and tell me whether the item is currently ON or OFF by finding whether the last word it finds is ON or OFF.

If a row spans ColumnsA:M say, and contains only blanks, numeric values or ON or OFF then please try, say in ColumnN and for Row2:
=INDEX(A2:M2,MATCH("zzz",A2:M2))

Related

SQL - Update groups of data based on start and end dates

I have a table with dates of service for various hospital stays and want to update the starting and end dates for each claim to match the length of the entire stay. The table below has seven inpatient stays and dates of service for each of those stays. A min_max flag of 1 or 2 means that the dates in that row cover the entire length of that specific stay (each stay is color-coded).
Current table image here
I need to updated the dates for all rows within each colored grouping to match the starting and end dates for the row which has a min_max flag of 1 or 2 within the same group to ultimately find the sum of claims in each stay. I could do this manually here or in excel but I need it done on a much larger scale with thousands of hospital stays.
Goal table here
TIA!

I need to convert total date to month only

I set up a google forms form for my work where my employees pass information and this information is recorded in a spreadsheet. The information, when recorded, automatically inserts a date and time in the first column of form responses. However, when I enter the code = month (a1), it always returns the answer "1" or "January" and this information does not match the date entered in the column. How do I fix this?
If you are entering '=month(a1)' for every row, then you are always taking the month of the top left cell in the sheet. You would need to adjust the row number for the row you are in.
You could use something like '=month(now())' to ensure you are always getting the month of the current date.

How to set the value of a cell depending of 2 other criteria

I have an Excel tab like this.
It give me information on when a worker is plan to start on a product.
The Columns of my input Table are:
Product Number, Dummy column, Dummy column, Worker ID, Starting Date, Ending Date
The lines in my input Table are:
Product 1,xyz,xyz,Worker 1,13/08/2018 13:50,20/08/2018 15:30
Product 1,xyz,xyz,Worker 2,08/08/2018 03:50,16/08/2018 08:30
Product 1,xyz,xyz,Worker 9,23/08/2018 08:08,03/09/2018 10:00
Product 2,xyz,xyz,Worker 4,10/08/2018 13:50,27/08/2018 15:30
Product 2,xyz,xyz,Worker 9,18/08/2018 03:50,20/08/2018 08:30
Product 3,xyz,xyz,Worker 2,13/08/2018 08:08,13/09/2018 10:00
My Result table should have:
one line per Worker
one Column for each day of the year
The values in the Result Tab should show for a given Worker and a Given Date on which Product the Worker started to work.
So the cell could be empty if at this date the workerX didn't start to work on a product.
Do you have an idea how I can solve this in Excel (or Access if not possible in Excel)?
Access is probably going to be your best bet. You will want to create a column that strips the time value from the Starting Date column, leaving you with only the day value. Let's call that the Starting Day for now. Now create a crosstab query based on your table. The rows will be based on the Worker ID column. The columns will be based on the Starting Day column. The value will use the aggregate function called "First()" on the Product Number field.
I think it should look something like this in SQL (replace <YOURTABLE> with your table name):
TRANSFORM First([Product Number])
SELECT [Worker ID] FROM <YOURTABLE> GROUP BY [Worker ID]
PIVOT [Starting Day]
Good luck!
Transfer your data in column A.
In cells C2 to C20, type the names of the workers Worker 1, Worker 2, etc, in the same way as it is present in the data.
In row 1, enter the dates, starting from cell D1.
In my example, cell D1 is 7 Aug 2018, E1 is 8 Aug 2018., …
In cell D2, enter the following Array Formula
=IF(MAX(IFERROR(FIND($C2&","&TEXT(D$1,"dd/mm/yyyy"),$A$1:$A$1000,1),0))=0,"-","Yes")
Array Formulas are entered using Control + Shift + Enter, instead of Enter.
Drag the formula to the required cells.
The result will be "Yes" if a worker has started a project on a particular date, and "-" if no project has been started by a worker on a particular date.
Change the cell references as required.
In place of "Yes", if you want to get the Product details as the result, then use the below Array Formula in cell D2.
=IFERROR(LEFT(IF((MAX(IF(IFERROR(FIND($C2&","&TEXT(D$1,"dd/mm/yyyy"),$A$1:$A$1000,1),0)>0,ROW($1:$1000),"-")))=0,"-",INDEX($A$1:$A$1000,(MAX(IF(IFERROR(FIND($C2&","&TEXT(D$1,"dd/mm/yyyy"),$A$1:$A$1000,1),0)>0,ROW($1:$1000),"-"))),1)), FIND($C2,IF((MAX(IF(IFERROR(FIND($C2&","&TEXT(D$1,"dd/mm/yyyy"),$A$1:$A$1000,1),0)>0,ROW($1:$1000),"-")))=0,"-",INDEX($A$1:$A$1000,(MAX(IF(IFERROR(FIND($C2&","&TEXT(D$1,"dd/mm/yyyy"),$A$1:$A$1000,1),0)>0,ROW($1:$1000),"-"))),1)),1)-2),"-")
Do let me know if this is what you wanted to do.
Regards,
Vijaykumar Shetye,
Spreadsheet Excellence,
Panaji, Goa, India

If particular cell is NOT BLANK copy down FORMULA from above cell

Basically I have the following formulas:
Column J: =IF(ISNA(VLOOKUP(I2,CCG,1,FALSE)),"Out of Area",VLOOKUP(I2,CCG,1,FALSE))
Column K: =INDEX(ResponsibleAgency,MATCH(N3,LeftLookup,0),MATCH(J3,TopLookup,0))
Column L: =IF(ISNA(VLOOKUP(N3,PPLookup,2,FALSE)),"Missing F Code",VLOOKUP(N3,PPLookup,2,FALSE))
Column M: =IF(ISNA(VLOOKUP(N3,PPLookup,3,FALSE))," ",VLOOKUP(N3,PPLookup,3,FALSE))
Basically, I only want these formulas to activiate provided that column A is populated with a date. If there is no date in column A, I want the cells to remain blank.
Is this possible?
Technically speaking, it is not possible to tell if cell contains a date or not in strict sense.
In Excel dates are in fact numbers representing number of days since January 1, 1900. I.e. today is 42066. It's the formatting that makes those numbers look like dates to user. If you pass a cell containing a date to any formula, it receives this number.
As a workaround, you can check if the cell satisfies two conditions:
It is a number.
It falls into some date range that makes sense.
For example, if your column contains goods delivery dates you usually don't expect them be previous century or 50 years into the future.
So you can wrap your formulae into something like this:
=IF(ISNUMBER(A1),IF(AND(A1>=DATE(2014,1,1),A1<=DATE(2015,12,13)),[LOGIC_IF_CORRECT_DATE_HERE],""),"")
Being said, it's still a workaround.

Excel, automatically updating variable in IF statement based on reference cell?

I have a sheet that needs to be updated monthly with a formula that needs to change with the month.
This is the formula: =IF($S3=AI$1,[#July],0)
The check is to make sure my values go into the correct category. After the category is determined correct, I need to take the month's values by referencing the month column in my table.
Question: Is there any way to make it so when I change the month somewhere, I can make the formula essentially move over a column to take the new month's values?
Note: I also have a similar case where instead of taking the month values verbatim, I'm summing the year's values til said month.
So I assume you have a table with column name January to December.
You can do this in at least two ways (I assume your month number is in cell A1)
Explicit: (in case these columns are not in order or adjacent to another)
=CHOOSE(A1,[#January],[#February], ... ,[#December])
Implicit: (if the months are next to each other:
=INDEX(TableName[#[January]:[December]],A1)
Obviously, I'd recommend the second option, if applicable.
If you want to sum from januar to the current month, you can use this little know trick/syntax:
=SUM([#January]:INDEX(TableName[#[January]:[December]],A1))