associating multiple time values with date in one column - excel

I have the a meter data with 30 min showing time in different columns and dates in rows like:
enter image description here
Is there any way I can associate the every time values with every date in rows like this like below.
I have been trying to use index match but I am unable to figure out what can work, tried different transpose and added the values as well, didn't work.
enter image description here

Based on your pictures, your data is on Sheet8. Therefore, type the following array formula into cell B2 on Sheet1 and drag down as far as necessary: (Line breaks added for readability)
= INDEX(Sheet8!$B$2:$G$8,
MATCH(DATE(YEAR(A2),MONTH(A2),DAY(A2)),Sheet8!$A$2:$A$8,0),
MATCH(ROUND(TIME(HOUR(A2),MINUTE(A2),SECOND(A2)),5),ROUND(Sheet8!$B$1:$G$1,5),0))
Note this is an array formula, meaning you must press Ctrl+Shift+Enter when entering it, instead of just Enter.
See below, I have the same formula but all in one sheet (i.e. references to Sheet8 are removed, and I change A2 to I2 in order to show all on one sheet, but otherwise the formula is the same.)

Related

Excel - Double press of the Fill Handle is filling to the end of column, not the end of adjacent dataset

Summary:
I am currently trying to fill a formula to a whole column in Excel to the end of an adjacent dataset (A2:A14500). Instead of the usual behaviour where Excel will flash-fill it to the end of the dataset in the adjacent column B2:B14500 for example, it instead flash fills it to the whole column (B2:B1048576), even past the end of the dataset in column A.
Use Case:
Column A is just a =FILTER command to pull from another sheet, excluding the blanks (in my live sheet, cell A1 is =FILTER('Raw'!A:A,'Raw'!A:A<>""). All other columns contain headers in cell 1:1. Cell B2 contains a basic 2 part =IF statement with an error catchall: =IF(ISERROR(VLOOKUP(A2,'Lookup'!A:B,2,FALSE)),"No",IF(VLOOKUP(A2,'Lookup'!A:B,2,FALSE)="Error","Yes","No"))
In my current example, the =FILTER in column A produces 14500 rows of data. I am attempting to use the fill handle to populate B3:B14500 with the =IF statement currently in cell B2. When I double press the fill handle, it fills the whole column of B3:B1048576, which causes Excel to crash (I am trying to do the same for 32 columns (B2:AG14500), so it is flash-filling over 33 million formulas instead of 600K).
Expected result when double clicking flash handle in formula column:
Data
Formula
1
Yes
2
Yes
3
No
4
Yes
Actual current result when double clicking flash handle in formula column:
Data
Formula
1
Yes
2
Yes
3
No
4
Yes
No
No
No
No
No
Final Comment:
Usually, when double pressing the fill handle on a formula in column B, I'd expect it to match the end of the dataset in column A (If column A contains data in cells A2:A100, I'd expect double pressing a formula in cell B2 to copy that formula to B2:B100, not B2:B1048576).
I know that copy-pasting is an option, as is manually dragging the fill handle down, but this involves me using weird Ctrl/Shift/Arrowkey combos to select the right range (this is supposed to be user friendly by others who don't use Excel much), or a long time holding the fill handle as there's 14K rows of data. Additionally, I am aware of Home>Fill>Down and Data>Flash Fill but neither of these work for me (Fill Down replaces the formula in B2 with the header in B1 and only copies down to B2, and Flash Fill tells me it can't see a pattern, despite providing it 1/2/5/10 cells of example data).
Any assistance with understanding why the double-click fill handle isn't working (I suspect it's due to the way it handles the =FILTER in column A), or how to overcome this would be appreciated. Currently using MSO365. Thanks!
PS. The reason I haven't filled the formulas manually is the number of cells in column A will change for each report generated with this spreadsheet, so the number of cells it needs to populate will vary.
=IF(ISERROR(VLOOKUP(A2#,'Lookup'!A:B,2,FALSE)),"No",IF(VLOOKUP(A2#,'Lookup'!A:B,2,FALSE)="Error","Yes","No"))
Adding # to the cell range that results in the spill will reference the whole spill. In case of lookup it'll spill the result of the lookups from the first to the last of the cells from the spill range.
PS since you own Office 365 you might want to look into XLOOKUP instead of VLOOKUP. XLOOKUP already has an embedded value if not found.

Incremental method to change the cells ID (Name)

I'm trying to setup an excel sheet with different columns and in every column I need the single cells to have a specific ID so I can reach to those by code, the simpler one was to put for ex. "column name1" and incremental from there, do you know a method to make something like that instead of changing all the cells ID by hand?
enter image description here
Like this one for example, but intead of having 'feature1' 'feature2' ecc written as text I need those in the cells IDs/Names
EDIT
example of table
Here I want to use a formula to automatically change the name of the table from "A26" to "step1", I tried to use command ="step"&ROW(A26) but this only change the text of the cell instead of the name
Although I have shared above what ROW Function, does, still for a proper explanation I am sharing here
The ROW function returns the row number for a reference.
In our query, ROW(J26) returns 26, since J26 is the twenty sixth row of the column J in the spreadsheet. When no reference is provided, ROW returns the row number of the cell which contains the formula. So in the above query ROW() returns 26 which on subtracting with 25 shall give us 1 which is required.
ROW function takes just one argument, called reference, which may be empty, a cell reference, or a range.
So the formula used in cell J26
=J$25&ROW()-25
And Fill Down and for the rest just press CTRL R and fill down!

Excel - Time Intersection

I want Excel to check whether two time intervals intersects or not.
For example, I3-J3 and I5-J5 intersects.
How can I make Excel to show this intersection in another cell?
The following formula will reveal any interference for the last row. Just copy this formula into cell K3 and copy it down:
=IF(OR(AND(OR(I3>(I$2:I2)),OR(I3<(J$2:J2))),AND(OR(I3>(I$2:I2)),OR(I3<(J$2:J2)))),"interference","OK")
Note that this is an array formula which will have to be entered using Ctrl+ Shift + Enter. For more information on array formulas you might want to read the following article: https://support.office.com/en-us/article/Guidelines-and-examples-of-array-formulas-7D94A64E-3FF3-4686-9372-ECFD5CAA57C7
If you want to show interference for both rows then you'd have to expand upon I$2:I2 and J$2:J2 to include the entire list. So, this might be (for example) I$2:I$500 and J$2:J$500 respectively. Yet, you cannot include the row itself. Otherwise, you'd always get interference because the formula would check against itself. So, you'd have to generate individual formulas for each row and you cannot enter a generic formula and copy it down.
I am not sure how to show (with formulas only) the interfering entry. This is mostly due to the fact that there might be more than one interfering entry which would then have to be listed and separated by ,. I don't think that can be done with formulas only.
Note: the above solution is based on the basic principle that all dates and times in Excel are (essentially) just numbers formatted as dates or time. For more information you might want to read the following: Change date format using substitute or replace
So, the above formula is just checking if the date in column I is between any prior date in column I and column J. If the date in column I is > and prior date in column I and also < compared to the date in column J then this is an interference. The same has to be checked for the date in column K and then both have to be combined with an OR. That's the entire formula above.
Update:
Based on the comment provided by #Gordon the formula can be improved with the COUNTIFS function. Just enter the following formula into cell C2 and copy it down:
=SUM(COUNTIFS(A:A,"<"&A2,B:B,">"&A2),COUNTIFS(A:A,"<"&B2,B:B,">"&B2))
Any number greater than 0 means that there is at least one interference. With this formula it is now counting / showing multiple interferences as you can see in the following screenshot:
Note, that the improved formula does not require anymore for you to know the range of the table. Instead you can search the entire column A:A and B:B for interferences.

Excel Formula to look up a value in another table, but bring through ALL results

I have set up data consolidation so the user can select from a list of dates. When the user changes the date, I want a formula (preferably a formula rather than VBA), if one exists, to look up the date in the table contained on the next page and bring through information based on this data.
I know that vlookups can look up on the table obviously with something like this:
=VLOOKUP(dateCell, table, colIndex, False)
But this seems to only bring through the first result- is there any way I can set this up so that after the first result has been brought through, I can bring through the second, third, fourth, etc. There will be multiple occurrences of each date so there will be multiple values that I want to bring through- one on each row.
See the example:
In A1:A5 values A,B,C,A,D
In B1:B5 values 3,5,6,8,9
Looking for value A in A1:A5 and get all the corresponding matches in B1:B5
Write this array formula in D1
=INDEX($B$1:$B$5;SMALL(IF($A$1:$A$5="A";ROW($A$1:$A$5);"");ROWS($D$1:D1)))
You get the first value (3), copy the formula down and you get all the others
Dont forget to Ctrl Shift Enter to enter the formula
Use AutoFilter to select the desired date, then copy all the visible rows to your destination.

Excel 2010: Counting cells with adjacent cell blank

I have data in rows where each column represents a day, some of which are blank and some of which have numbers. I want to "scan" down the row, comparing each cell with the one before to the left of it (or the one 2 spaces left of it, etc). For example, I want to sum the number of cells (days) with a blank in the cell before it. Or, I want to sum the number of cells that are greater than the cell to the left of it. I can't figure out how to dynamically compare to the prior column using addresses that change with each cell.
This is from what I understood from your Question:
If you refer to the screenshot below, you want to count Columns B to H if the column has a number and the column to the left is blank.
So, if this was just one column, we would write the formula as:
=COUNTIFS(B3,">0",A3,"")
Now since you want to do this for a range of columns (an array of cells), you need to do something like:
=COUNTIFS(B3:H3,">0",A3:G3,"")
and accept with a Ctrl + Shift + Enter.
So the formula would be displayed as:
{=COUNTIFS(B3:H3,">0",A3:G3,"")}
Array formulas are perfect for this task. I can't give you a lecture on the topic but you should read on it. Basically, you can select multiple cells in a range and act as if it was one cell.
For example, you could do something like this:
=SUM(IF($A$1:$A$100="", 1, 0))
When you enter array formulas, be sure to hit CTRL + SHIFT + ENTER in the formula box to signify that you want Excel to treat this formula as an array formula. Otherwise you will not get the expected results.
Using this method you can do any kind of comparison. Sometimes it helps to see how Excel treats the formula. You can select part of the formula in the formula editor and hit F9 to see what this segment computes to according to Excel.

Resources