Mohammad Basem
Well-known Member
- Joined
- Dec 24, 2011
- Messages
- 1,218
Greetings,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com
ffice
ffice" /><o
></o
>
<o
></o
>
I am new to this forum and this is my first problem to address.
I have problem with the below formula. It is supposed to show the last column used in the sheet, i.e. last column with a value in it,<o
></o
>
<o
></o
>
but I am getting the #N/A error instead.
<o
></o
>
<o
></o
>
After tracking the error, I found that Excel, no matter what number range in the argument, returns values from {1–16384}—I tried COLUMN(1:1), COLUMN(2:3) with same results.<o
></o
>
<o
></o
>
As a matter of troubleshooting, I replaced the number range with reference range,<o
></o
>
<o
></o
>
<o
></o
>
and it worked fine!<o
></o
>
<o
></o
>
I have the original formula’s sister<o
></o
>
<o
></o
>
<o
></o
>
working just fine to return the last row used.<o
></o
>
<o
></o
>
I want to keep using the number range (1:26) rather than the reference range (A:Z) and seeking any advice on what is wrong with the original formula.
It is worth to mention that I haven't experienced similar problems using the COLUMN function with number arguments.
<o
></o
>
Thank you in advance.<o
></o
>
MBA




<o


I am new to this forum and this is my first problem to address.
I have problem with the below formula. It is supposed to show the last column used in the sheet, i.e. last column with a value in it,<o


<o


Code:
[COLOR=navy]{=MAX(NOT(ISBLANK(A2:Z1000))*COLUMN(1:26))}[/COLOR]
<o


<o


After tracking the error, I found that Excel, no matter what number range in the argument, returns values from {1–16384}—I tried COLUMN(1:1), COLUMN(2:3) with same results.<o


<o


As a matter of troubleshooting, I replaced the number range with reference range,<o


<o


Code:
[COLOR=navy]{=MAX(NOT(ISBLANK(A2:Z1000))*COLUMN(A:Z))}[/COLOR]


and it worked fine!<o


<o


I have the original formula’s sister<o


<o


Code:
[COLOR=navy]{=MAX(NOT(ISBLANK(A2:Z1000))*ROW(2:1000))}[/COLOR]


working just fine to return the last row used.<o


<o


I want to keep using the number range (1:26) rather than the reference range (A:Z) and seeking any advice on what is wrong with the original formula.
It is worth to mention that I haven't experienced similar problems using the COLUMN function with number arguments.
<o


Thank you in advance.<o


MBA