View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
NDBC NDBC is offline
external usenet poster
 
Posts: 204
Default counting columns

I'm using v2003 and my understanding of your formula is it calculates the
difference between the cell where the formula is and cell g5. This is not
quite what I want to do. I want to put the formula in cell f5 and count the
difference between g5 and the last cell to the right in row 5 with data in
it. What's giving me the hassles is there could be blank cells in the middle
of the data range that need to be counted as well.

Thanks

"AltaEgo" wrote:

=COLUMN()-COLUMN($G$5)+1 {for inclusive column count}
=COLUMN()-COLUMN($G$5) {excludes the column with the formula}

--
Steve

"NDBC" wrote in message
...
I have a row of data that may have some blank cells in it. Is there a way
to
count the number of cells (including blanks) between say G5 and the
rightmost
cell with data in it using spreadsheet formulas, not vba code.

Thanks