Get value of cell above last cell in column - excel

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.

Related

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

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 :)

date based on yes or no value in another column

Column G will either be blank or have a yes or no in it. Column L has a date value in it. IF column G has a yes in it I want column R to subtract 9 months from the date in column L. If column G is blank or no I want Column R to remain blank.
Enter this formula in column R (the below formula will work for row 2):
=IF(G2="Yes",DATE(YEAR(L2),MONTH(L2)-9,DAY(L2)),"")
Note that the adjustment of 9 months might look a bit odd. If your date is, say, 30 November 2018, the formula is supposed to return 30 Feb 2018. However, since no date exists, it will instead return 02 March 2018 (which is Excel's way of saying as two days after 28 February 2018).

Index match returning N/A when lookup value is null

I have a summary sheet in a workbook that allows a user to enter in a 3 digit ID and some summary data and a chart populates. In the source data, the ID for the totals row is blank. So, when the lookup value is blank (no 3 digit ID is entered) I expected the Index Match formula to return the values corresponding to a blank cell in the lookup array, but it doesn't. How can I fix this?
Sampling of the data:
ID March April
111 10 15
222 15 10
333 10 10
35 35
Formula used:
=INDEX(B9:B12,MATCH(A1,A9:A12,0))
Where A1 is the lookup value
Say we have data like:
and we want to enter the name in A1 and retrieve the age in B1 and also accommodate the blank in column E.
In B1 enter:
=IF(A1="",INDEX(F:F,MATCH(TRUE,INDEX(ISBLANK(E1:E30),0,0),0)),VLOOKUP(A1,E2:F21,2,FALSE))
You cannot lookup a blank cell. Use IFERROR to find the first blank with AGGREGATE in the target if you receive an #N/A.
=INDEX(B9:B12, iferror(MATCH(A1,A9:A12,0), aggregate(15, 6, row($1:$4)/not(len(A9:A12)), 1)))
row($1:$4) is the position within B9:B12 that you are returning to the INDEX.

excel formula to extract dates with highest trade count

I need excel formula to show the dates when the trade count was maximum. Below mentioned are the excel columns
trade count. date
10 9 jan
12 8 jan
12 7 jan
Result : 7 jan & 8 jan
so the result can be highlighted in two different rows. or whatever convenient format.
kindly advice how it can be done easily.
Let your column C provide you with all the dates on which the MAX happens. You can always hide column C later.
Let C1 be the maximum from column A:
=MAX(A:A)
Now in each row, column C can build up your final output string. Copy from C2 down:
=IF($C$1=A2,TEXT(B2, "dd mmm"),"")
This gives you a column of either blank values, or the dates you need (correctly formatted as text).
Use column D to build up your final output string, by looking down column C:
=IF(C2="",IF(D3="","",D3),IF(D3="", C2,D3&" & "&C2))
Your result string will be given by cell D2.

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