Solving a complicated matrix problem in excel - excel

First time asking for advice here so I apologize if my terminology is messed up.
Here is what I'm trying to figure out how to solve (ideally in excel):
Given I can have up to 5 groups (A), and each group could have up to 4 entries (B), how do I evenly distribute B where the sum always equals 100.
Example 1:
Group A1 - Entry B1 = 15
Group A1 - Entry B2 = 15
Group A1 - Entry B3 = 15
Group A1 - Entry B4 = 15
-----
Group A2 - Entry B5 = 20
Group A2 - Entry B6 = 20
SUM OF B1:B6 = 100
Example 2:
Group A1 - Entry B1 = 25
Group A1 - Entry B2 = 25
----- <br/>
Group A2 - Entry B3 = 50
SUM OF B1:B3 = 100
Example 3:
Group A1 - Entry B1 = ???
Group A1 - Entry B2 = ???
Group A1 - Entry B3 = ???
----- <br/>
Group A2 - Entry B4 = ???
----- <br/>
Group A3 - Entry B5 = ???
Group A3 - Entry B6 = ???
SUM OF B1:B6 = 100

With your allocation in a table that can be referenced use this:
=VLOOKUP(A2,D:E,2,FALSE)*100/COUNTIF(A:A,A2)
Where your allocation table is in Columns D and E.

Related

Multiply a number by previous cell and different column

I wish to know if it is possible to multiply column(A) by column(B) and then keep on multiplying the last column(A) result by column(B), in a fast way instead of doing it manually that is.
For example:
A1 = 200
B2 = 0.8
C1 = A1 * B2 = 160 OR C1 = 200 * 0.8
C2 = C1 * B2 = 128
C3 = C2 * B2 = 102.4
C4 = C3 * B2 = 81.92
Etc...
You can use:
=SCAN(200,SEQUENCE(4),LAMBDA(a,b,a*0.8))
Note that you can use references for both 200 and 0.8.
You can use exponents to make the dynamic formula you describe based on the row. So if you put this in cell A2 and it would do what you describe, and then just drag down:
=$A$1*($B$2)^row()
Example on google Sheets (same formula works on Excel).

Excel Formula || How to count occurrences of a value in column

Need some help in figuring out an formula to count the number of times a value is listed in a column. I will try and explain the requirement below.
The below image show sample of data set.
The requirement is to list out issues and actions per customer.
As you can see, even from values clustered in cell, we need to find out individual unique values and then map it against the adjacent column or columns.
It just need an extra sheet/table to execute..
try :
A1 = a,b,c
A2 = b,c
A3 = c,b,a
A4 = c,a
A5 = b
B1 = ss
B2 = ss
B3 = dd
B4 = dd
B5 = ss
D1 = a
E1 = b
F1 = c
C7 = ss
C8 = dd
D2 =IF(FIND(D$1,$A2,1)>0,1,"") drag until F6
D7 =COUNTIFS($B$2:$B$6,$C7,D$2:D$6,1) drag until F8
D7:F8 will be your desired results. Happy trying.

Add A1 to C1 if B1 = Specific Number

I will try to be as clear and concise as possible. I am working on a spreadsheet in which I have item prices listed in a range of A1:A40. B1:B40 lists a numerical digit (either 1, 2, 3, etc.) that corresponds with a purchase category type (groceries, gas, etc.). Now I want one cell, such as C1, to add all instances in the A range that equal a specific number in B.
For example:
A1 = $5.00 | B1 = 1 | C1 = The sum in range A1:A3 if it's corresponding B value is equal to 1 (In this case B1 and B3, so C1=A1+A3)
A2 = $2.50 | B2 = 2 | C2 = The sum in range A1:A3 if it's corresponding B value is equal to 2 (In this case B2, so C2= B2)
A3 = $4.00 | B3 = 1 | C3 =
Use SUMIF Function
SUMIF(range, criteria, [sum_range])
In Cell C1 enter the formula = SUMIF(B:B,1,A:A)

find last same value in column x and add or deduct column y

similar to a post back in May, I also need to create a sheet that includes (3) different sources of information to create a running total based on the last same value
this example is what I need to happen
Column A = D (to add) or W (to deduct)
Column B = Source1 or Source2 or Source3
Column C = the value that needs to be added or deducted
Column D = the running total based on the source (Column B)
A1 = D
B1 = Source1
C1 = 100
D1 = 100 (0 + C1)
A2 = W
B2 = Source1
C2 = 25
D2 = 75 (D1 - C2)
A3 = D
B3 = Source2
C3 = 50
D3 = 50 (0 + C3)
A4 = D
B4 = Source1
C4 = 100
D4 = 175 (D2 + C4)
A5 = W
B5 = Source2
C5 = 10
D5 = 40 (D3 - C5)
A6 = D
B6 = Source3
C6 = 20
D6 = 20 (0 + C6)
Any help would be greatly appreciated
Have tried inserting a picture, however as I am a new to the site I am unable to...sorry about that
I am using this which adds correctly
=SUMIFS($C$1:$C1, $A$1:$A1, A1, $B$1:$B1, B1)
however, I also need to make it deduct if Column A = W
Put this in cell D1 and copy it down: =SUMIFS($C$1:$C1,$B$1:$B1,B1,$A$1:$A1,"D")-SUMIFS($C$1:$C1,$B$1:$B1,B1,$A$1:$A1,"W").
I was able to get started using the formula that you provided. I modified it so that it subtracted a running total of W's for each source from a running total of D's for each source.

Looking up data in two columns

I have a question regarding the vlookup function or any other ways which could help me derive to this outcome.
I have 3 columns of data, A,B & C.
I would like to identify any data in column A that comes up in column C.
Then, I would like the new column D to reflect the data in column B in the same row as the match found in column A.
I am sorry if this is confusing.
Here is the example;
A1 - 1
A2 - 2
A3 - 3
A4 - 4
A5 - 5
B1 - abc
B2 - def
B3 - ghi
B4 - jkl
B5 - mno
C1 - 2
C2 - 4
C3 - 5
C4 - 7
C5 - 9
I would like D to look for a match from column C in column A and reflect the data in column B.
This would be the result I need.
D1 - def
D2 - jkl
D3 - mno
D4 -
D5 -
This can be done with a simple VLOOKUP formula - enter this in D1 and copy it down:
=VLOOKUP(C1,A:B,2,0)
Even better than VLOOKUP is INDEX/MATCH, i.e. this formula:
=INDEX(B:B,MATCH(C1,A:A,0))
Both approaches lead to the same result, the later is a bit more robust when you change your sheet structure.

Resources