根据A列中的值旋转B,C等列中的值

时间:2019-04-20 15:08:10

标签: google-sheets array-formulas google-sheets-formula

我知道在Python熊猫中,您可以执行all sub-projects/modules. buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.2.1' // Firebase import classpath 'com.google.gms:google-services:4.2.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files // Stupid kotlin build-in plugin } } allprojects { repositories { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } apply plugin: 'com.android.application' repositories { jcenter() } android { compileSdkVersion 28 testOptions { unitTests { includeAndroidResources = true returnDefaultValues = true } } defaultConfig { applicationId "com.example.olegario.escamboapp" minSdkVersion 21 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'com.android.support:design:28.0.0' implementation 'com.android.support:support-v4:28.0.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' // Scroll view implementation 'com.android.support.constraint:constraint-layout:1.0.2' // Firebase implementation 'com.google.firebase:firebase-core:16.0.5' // Firebase database implementation 'com.google.firebase:firebase-database:16.0.6' // Firebase storage implementation 'com.google.firebase:firebase-storage:16.0.1' // Firebase authentication implementation 'com.google.firebase:firebase-auth:16.0.5' // Mask implementation 'com.vicmikhailau:MaskedEditText:2.0.4' // test testImplementation 'junit:junit:4.12' testImplementation 'androidx.test:core:1.0.0' testImplementation 'org.mockito:mockito-core:1.10.19' testImplementation 'org.robolectric:robolectric:4.2' androidTestImplementation 'org.mockito:mockito-android:+' androidTestImplementation 'com.android.support:support-annotations:24.0.0' androidTestImplementation 'com.android.support.test:runner:0.5' androidTestImplementation 'com.android.support.test:rules:0.5' androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2' androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:3.0.2' // Framework implementation project(':capuccino') } apply plugin: 'com.google.gms.google-services' 来旋转单元格值。

这里我想根据A列旋转B和C列的值:

enter image description here

所需结果:

enter image description here

当我更改Google表格中的其他值时,我需要即时更新它,否则,我会将其导出到pandas数据框并从那里融化。

如何在Google表格中“融化”,这样轮换会即时更新?如果没有内置功能,我该如何在Google Sheets javascript中执行此操作?


注意:meltTranspose)似乎很有希望,但是它不会旋转表格,它只会将B和C中的单元格值移动到A之下:

enter image description here

4 个答案:

答案 0 :(得分:1)

Example on Sheets.

screenshot of example

第1行在A,B,C等列中包含“ hello world”,“ stringA”,“ stringB”等。

我将从第3行开始输出(输出到A,B列,从第3行开始)。

您可以在第二列中使用移调,例如像这样将转置放在B3中:

=TRANSPOSE(B1:1)

然后您可以在A3中通过此操作获得列A的静态值:

=ARRAYFORMULA(if(NOT(ISBLANK(B3:B)),$A$1,""))

表示要注意从第3行开始的B列,如果B列中有内容,则从A1中添加静态值。

当您在第1行中添加值时,这将动态增长垂直列表,并且静态值将跟随A1的值。

答案 1 :(得分:1)

=ARRAYFORMULA(TRIM(SPLIT(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(TRANSPOSE(
 IF(B1:C<>"", "♠"&A1:A&"♦"&B1:C, )), , 999^99)), , 999^99), "♠")), "♦")))

0

答案 2 :(得分:0)

您可以使用典型的联接拆分组合

=ARRAYFORMULA(SPLIT(A2&""&TRANSPOSE(B2:C2),""))

答案 3 :(得分:0)

={{A1:A2,B1:B2};{A1:A2,C1:C2};{A1:A2,D1:D2}}

在此数组中添加尽可能多的列。我假设数据有4列,其中A列为前导列。

snapshot of the data and the solution