Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9786

In Google Sheets, can you repeatedly autofill until next non-blank cell or until a value in another column changes, whichever comes sooner?

$
0
0

I'm trying to format a CSV file that contains a huge list of products (8000+) that are on separate rows but need all the fields to be on the same row. The trouble is that some of the cells are intentionally left blank, so I'd want to stop autofilling once the product ID changed, then resume the autofill once it reached the next product that also had a nonblank cell. I've tried a few things:

=ARRAYFORMULA(VLOOKUP(ROW(W:W),{IF(LEN(V:V),LOOKUP(UNIQUE(V:V),V:V,ROW(V:V))),FILTER({ROW(W:W),W:W},W:W<>"")},2,TRUE))

error but counting the number of changes correctly

=ARRAYFORMULA(IF(LEN(V:V),LOOKUP(UNIQUE(V:V),V:V,ROW(V:V),VLOOKUP(ROW(W:W),FILTER({ROW(W:W),W:W},W:W<>""),2,TRUE))))

error but showing FALSE in the right places=ARRAYFORMULA(IF(LEN(V:V),LOOKUP(UNIQUE(V:V),V:V,VLOOKUP(ROW(W:W),FILTER({ROW(W:W),W:W},W:W<>""),2,TRUE))))

returning some values but in a strange order

Mockup of file: https://docs.google.com/spreadsheets/d/1DAIDk5EphV-RPGzo4Um4k0RZn0A2uhsTiPUApDzafRg/edit?usp=sharing (in this case, it would check when the value of column A changes and stop copying the nonblank cell values of column B)

Any suggestions would be much appreciated!


Viewing all articles
Browse latest Browse all 9786

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>