Google Sheets cell info

一笑奈何 提交于 2021-02-04 08:25:34

问题


I am doing a ledger for accounting purposes. I have it set up like a checkbook registry. It has 4 columns: Date, Description, Amount and Balance. The formula set up in the last column (Balance) is set up to add the number in the "Amount" column to the balance in the last line entry. The formula is copied down the page in the last column. What I would like to do, is only have a number in that column if there is an entry on that line. Here is my question: Is there a way to hide the number in the last column until there is an entry on that line? What I would like is for the additional entries of $15 to remain hidden until there is a value in the "Amount" column on that particular row.

I hope this all makes sense! I'm at a loss! Any help is appreciated :)


回答1:


simple and slow:

=INDEX(IF(C2:C="",, MMULT(
 TRANSPOSE((ROW(C2:C)<=
 TRANSPOSE( ROW(C2:C)))*C2:C), ROW(C2:C)^0)))


simple and short with medium speed:

=INDEX(IF(C2:C="",,SUMIF(ROW(C2:C), "<="&ROW(C2:C), C2:C)))


advanced and fast:

=ARRAYFORMULA(MMULT(
 TRANSPOSE((ROW(INDIRECT("C2:C"&MAX(ROW(C:C)*(C:C<>""))))<=
 TRANSPOSE( ROW(INDIRECT("C2:C"&MAX(ROW(C:C)*(C:C<>""))))))*
                INDIRECT("C2:C"&MAX(ROW(C:C)*(C:C<>"")))),
          QUERY(INDIRECT("C2:C"&MAX(ROW(C:C)*(C:C<>""))),  
          "select 1 label 1''")))



来源:https://stackoverflow.com/questions/65545241/google-sheets-cell-info

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!