Okay, so suppose we have the data set up like so:
Area 1 10 sq m
Wall 1 5 sq m
Wall 2 6 sq m
Wall 3 5 sq m
Wall 4 6 sq m
Area 2 21 sq m
Wall 1 7 sq m
Wall 2 4 sq m
Window 1 2 sq m
Wall 3 7 sq m
Window 2 2 sq m
Wall 4 4 sq m
And in another sheet, the data is to be presented like so:
Total interior wall area __ sq m
Area 1 __ sq m
Area 2 __ sq m
Total floor area __ sq m
Area 1 __ sq m
Area 2 __ sq m
How would I do this automatically?
What I was thinking is:
Look for cells with a specific tag (like "wall") in them
Get the number value to the right, under the "AREA" column
Get the sum of all those values
My problem with this algorithm is that I do not know how to execute it, not knowing the specific functions needed. Or, maybe there are other ways to do this with specific functions that I do not know of. Thank you very much to those who would answer, this is my first question on this website.
=ARRAYFORMULA({SUM(FILTER(D1:D, REGEXMATCH(LOWER(B1:B), "wall")));
QUERY({IF(A1:A<>"", A1:A, IF(B1:B="",,VLOOKUP(ROW(A1:A),
IF(A1:A<>"", {ROW(A1:A), A1:A}), 2, 1))), B1:B, D1:D},
"select sum(Col3)
where lower(Col2) contains 'wall'
group by Col1
label sum(Col3)''", 0)})
Related
I want to make the total of values every each member or names in every each their own group at the first match (or after blank space) or highest values positions of each them on column "D" according to column "B" with the result's row of an output like the exactly as an EXPECT OUTPUT as act of what I've just created on column "E". That's the replace a little bit down of just only one row from the column "B" positions or row must be the same as the column "C" and "D". Could we do this anyway ?
My achievements: I feel I've tried this before and got succeed to achieve this but I've forgot how to solve this when that happened. But it's look like kinda this code of formula:
=FILTER(IF(IFERROR(MATCH($B$3:$B;$B:$B;0);0)=ROW($B$3:$B);SUMIF($B$3:$B;$B$3:$B;$D$3:$D);"");$B$3:$B<>"0")
I don't know if I'm right or wrong but please see the table I'd created at the down below this and also see how I expected with that and feel free as well to edit to my doc file of google sheet I attached down below this.
THIS HERE YOU CAN EDIT TO MY SAMPLE G.SHEET TO SOLVE THIS MY QUIZ. THANKS IN ADVANCE!
A
B
C
D
E
1
2
N U M B
I D - M E M B E R
I D - C O D E
V A L U E S
E X P E C T O U T P U T
3
4
4
JYFI7
5
JYFI7
J3573
3
6
6
JYFI7
IYR
1
7
JYFI7
F498S
2
8
9
3
DFJ9F11
10
DFJ9F11
C684J
7
8
11
DFJ9F11
J58
1
12
13
2
H684K
14
H684K
JF585
2
2
15
16
1
FJSR
17
FJSR
4684
7
16
18
FJSR
834
1
19
FJSR
49
2
20
FJSR
9835
6
Here's a possible solution:
=ARRAYFORMULA(LAMBDA(cusum,IF(SCAN(,cusum,
LAMBDA(acc,cur,if(cur="",,acc+1)))=1,cusum,))
(SORT(SCAN(,SORT(D3:D,ROW(D3:D),0),
LAMBDA(acc,cur,if(cur="",,acc+cur))),ROW(D3:D),0)))
You can find it in tab 'z' cell F3.
I have a constant number X. I also have two numbers that add up to it. How can I make it so that if I change one number, the other number automatically changes so that it still adds up to X.
I have tried to take subtract the one number from X and add it to the other number, but instead I got two numbers in the thousands.
Assuming your constant value is 10, you can set this in a cell and make all your other calculations based on it.
For example, you can have cell C2 containing your constant, in this example, 10
Then in C4 you can have the number which you change, and the value of C5 will be equal to the value of the constant minus the value in C4.
You can then finally do your sum wherever you want, adding up the values of C4 and C5.
Here's an example Spreadsheet:
Untitiled spreadsheet ☆
File Edit View Insert Format Data Tools Extensions Help Last edit was 2 minutes ago
↶ ↷ 🖶 ⮷ | 100%⯆ | $ % .0 .00 123⯆ | Default(Ro... ⯆ | 10 ⯆ | B | I | S | A |⯐|☰
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
1
2
Contsant:
10
3
4
Number 1:
3
5
Number 2:
=(C2 - C4)
6
7
Sum:
=(C4 + C5)
8
I have been given matrices filled with alphanumerical values excluding lower case letters like so:
XX11X1X
XX88X8X
Y000YYY
ZZZZ789
ABABABC
and have been tasked with counting the repetitions in each row and then tallying up a score depending on the ranking of the character being repeated. I used {⍺ (≢⍵)}⌸¨ ↓ m to help me. For the example above I would get something like this:
X 4 X 4 Y 4 Z 4 A 3
1 3 8 3 0 3 7 1 B 3
8 1 C 1
9 1
This is great but now I need to do a function that would be able to multiply the numbers with each letter. I can access the first matrix with ⊃ but then I am completely lost on how to access the other ones. I can simply write ⊃w[2] and ⊃w[3] and so forth but I need a way to change every matrix at the same time in one function. For this example, the array of the ranking is as follow: ZYXWVUTSRQPONMLKJIHGFEDCBA9876543210 so for the first array XX11X1X
which corresponds to:
X 4
1 3
So the X is 3rd in the array so it corresponds to a 3 and 1 is 35th so it's a 35. The final scoring would be something like (3×104)+(35×103). My biggest problem is not necessarily the scoring part but being able to access each matrix individually in one function. So for this nested array:
X 4 X 4 Y 4 Z 4 A 3
1 3 8 3 0 3 7 1 B 3
8 1 C 1
9 1
if I do arr[1] it gives me the scalar
X 4
1 3
and ⍴ arr[1] gives me nothing confirming it so I can do ⊃arr[1] to get the matrix itself and have access to each column individually. This is where I'm stuck. I'm trying to write a function to be able to do the math for each matrix and then saving those results to an array. I can easily do the math for the first matrix but I can't do it for all of them. I might have made a mistake by making using {⍺ (≢⍵)}⌸¨ ↓ m to get those matrices. Thanks.
Using your example arrangement:
⎕ ← arranged ← ⌽ ⎕D , ⎕A
ZYXWVUTSRQPONMLKJIHGFEDCBA9876543210
So now, we can get the index values:
1 ⌷ m
XX11X1X
∪ 1 ⌷ m
X1
arranged ⍳ ∪ 1 ⌷ m
3 35
While you could compute the intermediary step first, it is much simpler to include most of the final formula in in Key's operand:
{ ( arranged ⍳ ⍺ ) × 10 * ≢⍵ }⌸¨ ↓m
┌───────────┬───────────┬───────────┬─────────────────┬───────────────┐
│30000 35000│30000 28000│20000 36000│10000 290 280 270│26000 25000 240│
└───────────┴───────────┴───────────┴─────────────────┴───────────────┘
Now we just need to sum each:
+/¨ { ( arranged ⍳ ⍺ ) × 10 * ≢⍵ }⌸¨ ↓m
65000 58000 56000 10840 51240
In fact, we can combine the summation with the application of Key to avoid a double loop:
{ +/ { ( arranged ⍳ ⍺ ) × 10 * ≢⍵ }⌸ ⍵}¨ ↓m
65000 58000 56000 10840 51240
For completeness, here is a way to use the intermediary result. Let's start by working on just the first matrix (you can get the second one with 2⊃ instead of ⊃ ― for details, see Problems when trying to use arrays in APL. What have I missed?):
⊃{⍺ (≢⍵)}⌸¨ ↓m
X 4
1 3
We can insert a function between the left column elements and the right column elements with reduction:
{⍺ 'foo' ⍵}/ ⊃{⍺ (≢⍵)}⌸¨ ↓m
┌─────────┬─────────┐
│┌─┬───┬─┐│┌─┬───┬─┐│
││X│foo│4│││1│foo│3││
│└─┴───┴─┘│└─┴───┴─┘│
└─────────┴─────────┘
So now we simply have to modify the placeholder function with one that looks up the left argument in the arranged items, and multiplies by ten to the power of the right argument:
{ ( arranged ⍳ ⍺ ) × 10 * ⍵ }/ ⊃{⍺ (≢⍵)}⌸¨ ↓m
30000 35000
Instead of applying this to only the first matrix, we apply it to each matrix:
{ ( arranged ⍳ ⍺ ) × 10 * ⍵ }/¨ {⍺ (≢⍵)}⌸¨ ↓m
┌───────────┬───────────┬───────────┬─────────────────┬───────────────┐
│30000 35000│30000 28000│20000 36000│10000 290 280 270│26000 25000 240│
└───────────┴───────────┴───────────┴─────────────────┴───────────────┘
Now we just need to sum each:
+/¨ { ( arranged ⍳ ⍺ ) × 10 * ⍵ }/¨ {⍺ (≢⍵)}⌸¨ ↓m
65000 58000 56000 10840 51240
However, this is a much more circuitous approach, and is only provided here for reference.
I would like to design an organization chart and I am building a supervisor tree like this.
9 8 7 6 5 4 3 2 1 0
A B C
D
E F B C
By using vlookup I got the table like above.
Now I would like the table to be like this:
9 8 7 6 5 4 3 2 1 0
A B C
D
E F B C
I tried
=IFS(ISBLANK(I2),H2,ISBLANK(H2),G2,ISBLANK(G2),F2,ISBLANK(F2),E2,ISBLANK(E2),D2,ISBLANK(D2),C2,ISBLANK(C2),B2,ISBLANK(B2),A2)
But it turned out to be #REF
I just would like to move the data to the right, to get rid of those empty cells.
Does anyone know how to do it? Or can we realize it in BigQuery?
try:
=ARRAYFORMULA(TRIM(SUBSTITUTE(IFERROR(SPLIT(REPT("♦♠",
IF(A2:A<>"", MMULT(IF(A2:J<>"", 0, 1), TRANSPOSE(COLUMN(A2:J)^0)), ))&
TRANSPOSE(QUERY(TRANSPOSE(IF(A2:J<>"", "♦"&A2:J, )),,999^99)), "♦")), "♠", )))
I have a filter/kernel like
| 1 1 1|
H = 1/m | 1 n 1|
| 1 1 1|
I want to know what is the relationship between m and n in this filter and how this relationship
effect the image using convolution.
There doesn't have to be any relationship between n and m, but if you want the convolution to be normalized, you need the sum of the kernel to be 1. In that case
m = 8 + n
The wiki page on kernels also explains that
Normalization ensures that the pixel values in the output image are of
the same relative magnitude as those in the input image.
Otherwise if m < 8 + n they will be brighter, or if m > 8 + n they will be dimmer.
NOTE
As pointed out by BЈовић, changing n changes the action of the filter significantly (see comments on this question).