简体   繁体   中英

Static Value in Google Sheets Array

I'm trying to create an array of values from a google sheet. I want to also return a static value. My formula looks like this at the moment

={A2:A5,$A$1,M2:M5}

I want it to return something like:

Person 1 Blue 5

Person 2 Blue 10

Person 3 Blue 15

Person 4 Blue 10

Person 5 Blue 7

EDIT

I have now updated the link below in the old answer to match what I think you are looking for. I have made three seperate sheets for you to look at and click around in at the bottom of the linked sheet.

I have used data validation to make some dropdowns for the teams. I have made a list of players where you can add and remove as much as you like (this may be flawed, tell me if you find an error and I'll look into it) - from there I use the data I fetched from the two sheets to make a total calculation with the built in SUMIF function. Hope this helps.

OLD ANSWER

Right - so I'm not quite sure what you need, but I found an example of what you may be looking for:

https://docs.google.com/spreadsheets/d/1hNQ_9c-ZTvoOu1Sd3egjHXsjeITFod88na0OEaBaF54/edit?usp=sharing

主题上下文菜单

表格数据验证模式

So when you look down at the bottom you can see another sheet that contains some static values. If you rightclick on any of the Subjects in the sheet Assignments and choose Data Validation as shown on the first image you will get the screen on the second image. Here you can see how the data som the sheet Subjects is referenced in the sheet Assignments

You can also rightclick one of the Status column values in the Assignment sheet to see how you can create a static list in the Data Validation context menu. Hope this answers the question. Either that or please provide more info for me to be able to decipher the question correctly ;)

try:

=ARRAYFORMULA(TRANSPOSE(QUERY(TRANSPOSE(IF(A2:B<>"", A1:B1&" "&A2:B, )),,999^99)))

0

假设$A$1是您想要重复 4 次的常量,您可以这样做,但它并不漂亮:

={A2:A5,{$A$1;$A$1;$A$1;$A$1},M2:M5}

It can easily work by using ARRAYFORMULA in combination with the defined array's

={A2:A6,B2:B6, ARRAYFORMULA(IF(ISBLANK(A2:A6), , $A$1))}

See result in Google sheets with formula above

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM