Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# Excel 2008 - Find last cell with data in row

Posted on 2011-09-13
Medium Priority
408 Views
I've searched for an answer, but it seems that I can only find VBA-based solutions, which appears to no longer be an option in Excel 2008.

I'm trying to return the name of the last cell in a row that contains data.

So, it looks like this:

``````+===========================================================+
A      /  B  /  C  /  D  /  E  (columns)
+===========================================================+
1         || [Formula] /  3  /  4  /  5  / [blank]
2         || [Formula] /  7  /  8  / [blank] / [blank]
3         || [Formula] /  9  / 10 / 11 / 12
(rows)
+===========================================================+
``````

And, the end result would look like this:

``````+===========================================================+
A       /  B  /  C  /  D  /  E  (columns)
+===========================================================+
1         || D1 /  3  /  4  /  5  /
2         || C2 /  7  /  8  /     /
3         || E3 /  9  / 10 / 11 / 12
(rows)
+===========================================================+
``````
0
Question by:n00b0101
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 4
• 3
• 2
• +1

LVL 18

Expert Comment

ID: 36529711
Hi,

try

=index(b\$1:e\$1,match(9.99999e+307,b2:e2))

Kris
0

LVL 50

Expert Comment

ID: 36529737
Try this formula in A1 copied down

regards, barry
0

LVL 35

Expert Comment

ID: 36529739
Are you using a Mac?

There are formulas to get the last value in a row, for example

=LOOKUP(9.99E+99,2:2)

Put this in A1 in and be copy down.

I'm sure getting the address, eg D1, etc but that's a but beyond me.
0

LVL 18

Expert Comment

ID: 36529758
Hi

Ignore the earlier post. Try

Kris
0

Author Comment

ID: 36529948
I've tried all of these, but it returns #N/A.  In some cases, the cell will contain text... I tried altering the MATCH statement to:

``````MAX(MATCH(9.9999E+307,B8:RJ8),MATCH(REPT("z",255),B8:RJ8))
``````

But, it continues to return #N/A
0

LVL 18

Assisted Solution

krishnakrkc earned 800 total points
ID: 36530004
Hi,

Kris
0

LVL 50

Expert Comment

ID: 36530014
For text or numbers....

regards, barry
0

LVL 50

Expert Comment

ID: 36530027
My version goes in A1, clearly for the range B8:RJ8 change to this in A8

barry
0

LVL 50

Accepted Solution

barry houdini earned 1200 total points
ID: 36530076
Sorry, scratch that last one, for that version to work the range should start at column A. Perhaps an amalgamation of the formula suggested by Kris....and my one, i.e. in A8

regards, barry
0

Author Closing Comment

ID: 36530243
Thanks, this one works.  I'm splitting the points (hopefully, fairly)...
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference texâ€¦
Excel can be a tricky bit of software to get your head around. Whilst youâ€™ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to dâ€¦
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calculâ€¦
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templaâ€¦
###### Suggested Courses
Course of the Month9 days, 23 hours left to enroll