View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Glenn Glenn is offline
external usenet poster
 
Posts: 1,240
Default Find the first or last populated column in a range

Commish wrote:
I have a range of data, from columns C through Z.
And I have about 100 rows of financial data. The rows represent
projects, and the columns represents periods where costs were
incurred. So, some rows have data from C-Z, and others have data from
H-M.

How can I write a formula in column a1, to tell me which was the first
column to have a value in row 1? And, likewise, I want to know which
column has the last value.


Array formula in A1 (commit with CTRL+SHIFT+ENTER):

=MIN(IF($C1:V1="","",COLUMN($C1:V1)))

Use MAX() for B1.