I need help with a Google Sheets formula to return the column header of the last >0 value in a row (the yellow highlighted cells below are hard-keyed).

Example:

enter image description here

New contributor
Shanda is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • So, in your sample, what are expecting to get back? – ale Oct 11 at 18:57

Shanda, given what I see in your snippet, and assuming that your first highlighted cell above is B2 and that the dates are in columns D:J, paste this into B2 and copy down as needed:

=ArrayFormula(IF(COUNTIF(D2:J2,">0")=0,"",INDIRECT(ADDRESS(1,COLUMNS(A2:D2)-1+MATCH(2, 1/(D2:J2>0),1)))))

New contributor
Erik Tyler is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

Shanda is a new contributor. Be nice, and check out our Code of Conduct.
 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.