How to check if cell is the last one in an Excel column -


this question has answer here:

i populating sheets database results. don't know how many rows result have. want have sheet variable number of rows has like:

if(this last row?, sum of previous cells, value) 

is there formula determining row last one? looking excel formula not vba code. maybe similar lookup or index or offset not aware of.

you can try udf:

function islastcellinrow(mycell range) boolean     if isempty(mycell) exit function      if mycell.end(xldown).row = mycell.entirecolumn.rows.count         islastcellinrow = true     end if end function 

the function checks if there non-empty cells below given cells , return true of false.

you can use udf this:

=if(islastcellinrow(sheet1!a1),sum(sheet1!a:a), "whatever") 

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -