find the last cell with a certain value and...

deLockloire

Board Regular
Joined
Apr 4, 2008
Messages
116
Office Version
  1. 365
Platform
  1. Windows
hi,

i'd like a formula, which finds the last "X" value in an array, e.g., C1:C30 (and it is possible that more cells in this column have the "X" value, but i need the very last one) and return the value of a cell from the same row in column A. So, if im looking for "X" and C1, C5, C8 and C9 has "X" as their values, I need to get the value of A9. could you help me out with this?
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hello, Try

=LOOKUP(2,1/(C1:C30="X"),A1:A30)

Do not use the whole column reference, like C:C, A:A. Use a range C1:C1000....
 
Upvote 0
hi,

i'd like a formula, which finds the last "X" value in an array, e.g., C1:C30 (and it is possible that more cells in this column have the "X" value, but i need the very last one) and return the value of a cell from the same row in column A. So, if im looking for "X" and C1, C5, C8 and C9 has "X" as their values, I need to get the value of A9. could you help me out with this?

Try...

Either just enter:

=LOOKUP(9.99E+307,SEARCH("X",C1:C30),A1:A30)

Or control+shift+enter, not just enter:

=LOOKUP(9.99E+307,IF(C1:C30="X",1),A1:A30)
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,756
Members
452,940
Latest member
rootytrip

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