Find last cell with data, then get column title

TAPS_MikeDion

Well-known Member
Joined
Aug 14, 2009
Messages
626
Office Version
  1. 2011
Platform
  1. MacOS
Hi everybody,
This seems like it will probably be an easy one for those of you who are better than I am with Google Sheets formulas.

I have columns R through AC marked JAN, FEB, MAR and so on for the months of the year, with staff rows starting at 3 with a simple X per staff member who attended a meeting that month. All I'm looking to do in column AD is to show the last month that has an X in the cell per staff member.

P​
Q​
R​
S​
T​
U​
V - AC​
AD​
1MEETINGS HELD
X​
X​
X​
2
JAN
FEB
MAR
APR
ETC​
LAST MEETING ATTENDED​
3JOE
X​
JAN
4BILL
X​
X​
MAR
5TOM
X​
X​
FEB

In the example above, column AD for rows 3, 4, and 5 should read:

3 - JAN
4 - MAR
5 - FEB

Thank you very much for your help on this!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
No idea if this works in sheets, but try
Excel Formula:
=lookup(2,1/(r3:ac3="x"),r$2:ac$2)
 
Upvote 0
Hi Fluff!
Using that formula in cell AD3, I got the following error:

#N/A
Error
Did not find value "2" in LOOKUP evaluation
 
Upvote 0
Thanks to your formula I was able to figure it out looking at how Google Sheets uses LOOKUP.

Here's what worked:
=LOOKUP("x",R3:AC3,R$2:AC$2)

The only issue I have now is figuring out how to tell Google Sheets to ignore an error, because if someone hasn't been to any meetings, I get:

#N/A

Error
Did not find value "x" in LOOKUP evaluation
 
Upvote 0
Try
Excel Formula:
=IFNA(LOOKUP("x",R3:AC3,R$2:AC$2),"")
 
Upvote 0
Solution
Glad to help & thanks for the feedback.
 
Upvote 0
Hello again,
How can I change this formula so that it finds the the farthest right column with data within the (new) range of column D to column O (for the MONTHS - ie JAN ,FEB, MAR...)?

Right now, if a meeting is cancelled, the formula that was working stops at the last meeting month prior to the cancelled meeting.
For example, our monthly meeting for April was cancelled. Anyone who attended the MAR & MAY meetings now show their last meeting as MAR instead of MAY.

Thank you!
 
Upvote 0
As long as there is an "X" for May then the formula should work.
 
Upvote 0
Hi Fluff,
I switched this over to Excel so that I could use VBA and used the original formula you gave me. It DOES work now, with the exception of anyone who hasn't attended a meeting. In that case I receive an N/A error.
 
Upvote 0

Forum statistics

Threads
1,224,872
Messages
6,181,499
Members
453,047
Latest member
charlie_odd

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