VLookup sorting from bottom to top

  • Thread starter Thread starter Legacy 185660
  • Start date Start date
L

Legacy 185660

Guest
Hey guys!
I tried googling this, but the answers I got were way too confusing for me to try to edit.
I need this VLOOKUP formula to search from bottom to top to find the last value.

=VLOOKUP(C3,'Signout History'!A:C,2,FALSE)

Thanks!
 
and could you make it so that if it does not find that number it returns a ""?
 
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Perfect!
That works!
Thanks a lot!

You're welcome!

Will this work for all rows of C?

I'm not familiar with Google Docs, so you'll have to try it.

...and could you make it so that if it does not find that number it returns a ""?

The IFERROR function can be used, if available on Google Docs. Otherwise, try...

=IF(COUNTIF('Signout History'!$A$2:$A$100,C3)>0,INDEX('Signout History'!$B$2:$B$100,LARGE(IF('Signout History'!$A$2:$A$100=C3,ROW('Signout History'!$A$2:$A$100)-ROW('Signout History'!$A$2)+1),1)),"")

...confirmed with CONTROL+SHIFT+ENTER.
 
Upvote 0
You're welcome!



I'm not familiar with Google Docs, so you'll have to try it.



The IFERROR function can be used, if available on Google Docs. Otherwise, try...

=IF(COUNTIF('Signout History'!$A$2:$A$100,C3)>0,INDEX('Signout History'!$B$2:$B$100,LARGE(IF('Signout History'!$A$2:$A$100=C3,ROW('Signout History'!$A$2:$A$100)-ROW('Signout History'!$A$2)+1),1)),"")

...confirmed with CONTROL+SHIFT+ENTER.

Learned that the array increases automatically by itself, which is perfect!
And thanks! I was using an IF statement with ISERROR, but IFERROR shortens it a bit

Anyway you can shorten:

=IF(D3="","",IF(TODAY()>DATEVALUE(INDEX('Signout History'!$C$2:$C$116,LARGE(IF('Signout History'!$A$2:$A$116=C3,ROW('Signout History'!$A$2:$A$116)-ROW('Signout History'!$A$2)+1),1)))+31,"Late: " & DATEVALUE(INDEX('Signout History'!$C$2:$C$116,LARGE(IF('Signout History'!$A$2:$A$116=C3,ROW('Signout History'!$A$2:$A$116)-ROW('Signout History'!$A$2)+1),1))),DATEVALUE(INDEX('Signout History'!$C$2:$C$116,LARGE(IF('Signout History'!$A$2:$A$116=C3,ROW('Signout History'!$A$2:$A$116)-ROW('Signout History'!$A$2)+1),1)))))
 
Upvote 0
Enter in one cell part of the formula (DATEVALUE/INDEX) that returns the date itself, and then in another cell test the date to see if it meets the criteria. So, for example, maybe something like this...

E3, confirmed with CONTROL+SHIFT+ENTER...

=IFERROR(DATEVALUE(INDEX('Signout History'!$C$2:$C$116,LARGE(IF('Signout History'!$A$2:$A$116=C3,ROW('Signout History'!$A$2:$A$116)-ROW('Signout History'!$A$2)+1),1))),"")

F3:

=IF(D3="","",IF(E3<>"",IF(TODAY()>E3+31,"Late",""),""))
 
Upvote 0
Enter in one cell part of the formula (DATEVALUE/INDEX) that returns the date itself, and then in another cell test the date to see if it meets the criteria. So, for example, maybe something like this...

E3, confirmed with CONTROL+SHIFT+ENTER...

=IFERROR(DATEVALUE(INDEX('Signout History'!$C$2:$C$116,LARGE(IF('Signout History'!$A$2:$A$116=C3,ROW('Signout History'!$A$2:$A$116)-ROW('Signout History'!$A$2)+1),1))),"")

F3:

=IF(D3="","",IF(E3<>"",IF(TODAY()>E3+31,"Late",""),""))

That is almost what I had in the beginning but I wanted it in 1 cell. I think I got it though.
Thanks for all your help! :biggrin:
 
Upvote 0
Does Google Docs allow Defined Names? If so, an alternative might be to use a defined name for IFERROR/DATEVALUE/INDEX, instead of placing it in a cell. This way the defined name is referenced instead of the cell.
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top