简体   繁体   English

如果相邻单元格为“向下”,则Google表格公式会为跳过列的行随机分配值

[英]Google Sheets Formula Randomly Assign Values To A Column Skipping Row If Adjacent Cell = “Down”

I have 3 columns whose values are randomly generated using this formula 我有3列,其值是使用此公式随机生成的

=sort(A1:A36,arrayFormula(randbetween(sign(row(A1:A36)),1000000)),true)

and displayed in columns (H,I,J) and I would like to copy these values into 3 new columns (L,M,N) but skipping the entire row if an adjacent cell within the row = "Down" (Column O). 并显示在(H,I,J)列中,我想将这些值复制到3个新列(L,M,N)中,但如果该行中的相邻单元格为“ Down”(O列),则跳过整行。

Below is a screenshot of my current state and problem. 以下是我当前状态和问题的屏幕截图。

当前

Below is a screenshot of what I want to accomplish using an excel formula. 下面是我要使用Excel公式完成的屏幕截图。 I currently just pasted the values to use as a reference of what I would like to accomplish. 目前,我只是粘贴了这些值以用作我要完成的工作的参考。

目标

So, you want to copy the data from some columns to some other columns, but skipping the rows where the O column is "Down". 因此,您想将数据从某些列复制到另一些列,但是跳过O列为“ Down”的行。 Not really specific to randomness of those values. 并不是真正针对那些值的随机性。 Here is my approach: 这是我的方法:

=if(O2 <> "Down", offset(H$1, countif(O$1:O1, "<>Down"), 0, 1, 3), )

The offset gets three cells in the row determined by countif , which is based on the number of cells that are not "Down" above the current row. offsetcountif确定的行中将获得三个单元格, countif基于当前行上方不“向下”的单元格数量。 This formula would need to be entered on the second row and copied down. 该公式将需要在第二行中输入并向下复制。 I wasn't able to find a solution that gives the entire array at once with some arrayformula . 我找不到一个可以通过一些arrayformula一次提供整个阵列的解决方案。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将公式向下复制到列,但在此处和此处跳过一行 - Copy formula down column, but skipping a row here and there Excel公式| 计算行中相邻单元格中具有“关键字”的所有值 - Excel Formula | Count all values that have the “keyword” in the adjacent cell in the row VBA 循环遍历列中的值,将值放置在影响公式的单元格中,并将结果公式复制并粘贴到相邻列 - VBA to loop through values in column, place values in cell that affects formula, and copy and paste resultant formula to adjacent column 如果相邻单元格不为空,将公式向下复制的宏 - macro to copy formula down if adjacent cell not blank Google表格公式,其中包含来自另一个单元格的值 - Google Sheets formula that includes values from another cell 尝试将公式向下沿整列复制到相邻列中的最后一行数据 - Trying to copy a formula down an entire column to the last row of data in an adjacent column Google脚本-如何将公式设置为相邻单元格 - Google Script - How to set formula to adjacent cell 获取特定列和可变行号的单元格值的公式 - Formula to get cell values of specific column and a variable row number 列中每一行的Excel VBA cell.Formula(就像我将公式向下拖动一样) - Excel VBA cell.Formula for each row in a column (as If I dragged down the formula) VBA从Sheet1 +中的唯一列值创建新工作表,以转移相邻行的信息 - VBA Creating new sheets from unique column values in Sheet1 + bringing over adjacent row information
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM