Trying to move information to sheet 2 based on a value of a cell from sheet 1 - excel

Column1
Column2
00003002300048421607
09 008A00
00003002300048414074
09 013A00
00003002300048415880
30 001A00
00003002300048418713
30 001A00
00003002300048416955
30 002A00
Lets say this table is in sheet1, I am trying to have a formula move a row into sheet 2 (a1 to a1, b1 to b1, etc.) if the 1st 2 digit number is less than 13 (01-12). For example on row 2 since the 1st 2 digit value is 09 I'd like that row moved to sheet 2, and on the other hand row 3 starts with 30 so I'd like nothing to happen there. Please let me know if you need anymore information to assist me, thank you :)

Related

Make formula for list of row names independent from entire column and first row

I have the following Excel spreadsheet:
A B C D E F G H
1 Q1 Q2 Q3 Q4 Search criteria: 60 Asset 2
2 Asset 1 15 85 90 70 Asset 3
3 Asset 2 40 80 45 60 Asset 3
4 Asset 3 30 60 55 60 Asset 5
5 Asset 4 12 72 25 15
6 Asset 5 60 48 27 98
7
In Cells A1:E6 I have different assets with their performance from quarter Q1-Q4.
In Column H I list all assets that match the search criteria in Cell G1.
In this case the search criteria is 60 which can be found in the Cells A1:E6 for the Assets 2, 3 and 5.
For creating the list I use the formula from here:
=INDEX(A:A,SMALL(IF($B$2:$E$6=$G$1,ROW($B$2:$E$6)),ROW(1:1)))
All this works fine so far.
Now when I move the Cells A1:E6 in the sheet for example to D9:H14 the array formula keeps only working if it still refers to A:A and ROW(1:1) which might be a problem if the user decides to delete ROW(1:1). Therefore, I tried to modify the formula to:
=INDEX($D$9:$D$14,SMALL(IF($E$10:$H$14=$J$10,ROW($E$10:$H$14)),ROW($D$9:$H$9)))
However, with this modification I get #NUM! error.
Do you have any idea if it is possible to make the array formula independent from A:A and ROW(1:1) so it refers only to the Cells A1:E6 and automatically moves when the those cells are moved?
If you use excel 2013 or later then you can use following formula.
=IFERROR(INDEX($D$10:$D$14,AGGREGATE(15,6,ROW($1:$5)/($E$10:$H$14=$J$10),ROW(1:1))),"")
You can limit A:A to A1:A6 so that it would adjust as necessary when you move it. Your formula should thus be now
=INDEX(A1:A6,SMALL(IF($B$2:$E$6=$G$1,ROW($B$2:$E$6)),ROW(1:1)))
As for ROW(1:1), your top formula should always be ROW(1:1) and when you drag it down, then next formula should have ROW(2:2). When you move your top formula somewhere else and the ROW(1:1) changes to something like ROW(9:9) or anything, change it to ROW(1:1).
Please note that 'moving' your formula is different from 'dragging it down'.
EDIT:
So after you moved your data set, the top formula should now be:
=INDEX($D$9:$D$14,SMALL(IF($E$10:$H$14=$J$10,ROW($E$10:$H$14)),ROW(1:1)))
This is assuming that cell G1 (criteria) is also moved to J10.

Excel horizontal list to columns

I am looking to format some data. To make it more easy I use an example with simple numbers.
Sheet 1 ('S1'):
A1 10
A2 14
A3 23
A4 12
A5 64
A6 32
.... etc
It is a long list(vertical) of 600 values
Now I want in Sheet 2('S2'):
To show it as:
S1!A1 S1!A2 S1!A3 S1!A4 S1!A5 S1!A6
S1!A7 S1!A8 S1!A9 S1!A10 S1!A11 S1!A12
S1!A13 S1!A14 S1!A15 S1!A16 S1!A17 S1!A18
References to the cells in the other sheet.
I have tried to transpose them but I cannot find a modifier to set an amount of columns used. i.e. I would get 1 row with all my data. I want only the first 6 in row, next 6 in next row, next 6... etc.
Thanks for any help/feedback given.
Put this in the upper left cell desired:
=INDEX(Sheet1!$A:$A,(ROW(1:1)-1)*6+COLUMN(A:A))
Then copy/drag over 6 columns and down till you finish the list
Sheet1

Get value of cell above last cell in column

I am looking for a formula that will get the value of the cell above the last cell in a column in Excel. I have the following formula that will get the value of the last cell in the column:
=LOOKUP(2, 1/('Historical Data'!A:A<>""),'Historical Data'!A:A)
But I am looking for the value of the cell that is right above it.
For example, if I have a table that looks like:
A B C
2013 09 $40
2014 10 $78
2015 02 $60
I'm looking for column A to return "2014", not "2015" as it does now.
To return the second to last value I would use INDEX.
=INDEX(A:A, COUNTA(A:A)-1, 1)
COUNTA to get the length of your array and -1 to step to the second to last value.
Setup a meta row.
For example, in column "D", adjacent to each cell issue the following formula.
=ROW()
Like so,
A B C D
2013 09 $40 1
2014 10 $78 2
2015 02 $60 3
At the end of the last row, issue a MAX command in the row column. In the aboe example, it will be D4.
=MAX(D1:D3)
D4 will have a value of 3
This tells that your range has 3 rows. You may then get your cell value by
=INDIRECT("A" & D4-1)
Which will give you the value of A2.
You may hide row D after everything checks out.

Transforming Date data from one column to several 24row columns

I have data output into one column by hour of day. I was wondering if there was any way to take that data from the one column, and spread it across multiple columns in 24 hour segments.
For example this is my data now:
Time 1st Day views
12:00AM 3
1:00AM 43
2:00AM 0
... ...
11:00PM 5
12:00AM 4
1:00AM 10
2:00AM 0
... ...
11:00PM 15
I want it to look like this:
Time 1st Day views 2nd Day Views
12:00AM 3 4
1:00AM 43 10
2:00AM 0 0
... ... ...
11:00PM 5 15
Any help would be appreciated.
Thanks,
Assuming header is in Row 1, time column is column A, views column is column B, and you know for certain that there is one data entry for each hour -- that is, there are no time gaps in column A --
Enter the formula in cell C2: =OFFSET($B2,24*COLUMNS($B:B),0)
Drag the formula down from cell C2 to cell C25. Then drag the whole highlighted range, c2:c25, to the right until you start seeing zeros. Highlight cell B2 and drag to the right to autofill the header.

vlook up for multi combination value

Friend.
I have sheet1 like below
Jan Feb Mar Apr
A 10 15 13 10
B 11 11 15 12
C 12 13 15 14
D 12 10 10 15
In Sheet 2! i have 2 scroll scroll down list in cells made by data validation.fist one is in A1 with the values A, B and C, in A2 cell with the values Jan,Feb,Mar.
What i need on this, if i select A and Jan from scroll down list. i need to show the value as '10' in A3 Cell
I tried VLook up with my limited knowlege but i can provide only one value in Lookup value and array.
Please help.
You have to provide vlookup a number of column to return as variable, which you may get as a return value of match function.
Sheet1 has populated range A1:E5, where first row contains names of months (range A1:E1). Sheet2 has only values in two cells A1 and A2.
You need to find in which column of Sheet1 is a month, that is done by
match(a2, Sheet1!A1:E1, 0)+1
and find the value with VLOOKUP.
The final formula would be
=vlookup(a1, sheet1!a1:e10, match(a2, sheet1!A1:e1, 0)+1, false)
EDIT: The first time I messed Sheet1 and Sheet2.

Resources