Multiply a number by previous cell and different column - excel

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).

Related

Simple two cells check and calculate

I have problems with this formula and cant get it right.
I cant use the "IFS" in my excel.
Want I would like to calculate for Cell C1:
If A1 is empty and B1 is empty = 0
If A1 is not empty and B1 is empty = A1
If A1 is empty and B1 is not empty = B1
If A1 is not empty and B1 is not empty = (A1*0,6) + (B1*0,4)
Example for last
A1 = 20 and B1 = 2
= (A1*0,6) + (B1*0,4)
= 20 *0,6 + 2*0,4
= 12 + 0,8
= 12,8
Thank you

Sum only cells with prefix letter in a row

I have data in Row 1 as follow:
A1 = 8
A2 = 9
A3 = CN2.75
A4 = CN3
I would like the result in cell B2 = sum range A1 to A4 and only sum cells with prefix letter "CN". The sum result in cell B2 should be = 2.75 + 3 = 5.75
=SUMPRODUCT(+IF(LEFT(A1:A4,2)="CN",1,0),IFERROR(VALUE(RIGHT(A1:A4,LEN(A1:A4)-2)),0))
Prefer even JvDV's Version from the comments, even more efficient
Enter as an array formula Ctrl+Shift+Enter

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.

Excel - Find last same value in Column X and add Column Y to current cell

I have a sheet that includes (3) different sources of information, where the source is determined in ColumnA, MoneyOut = ColumnB, MoneyIn = ColumnC, and SourceTotal = ColumnD.
When working with a current row, how can I find the last row in which ColumnA = CurrentRowColumnA[Value], and sum(PrevColumnB[Value]+PrevColumnC[Value]) to CurrentRowColumnD[Value].
Ex:
A1 = Source1
B1 = 200
C1 = 200
D1 = 400
A2 = Source2
B2 = 300
C2 = 200
D2 = 500
A3 = Source1
B3 = 200
C3 = 600
D3 = 1200 (D1 + sum(B3+C3))
How can I write a function to do this continuous addition without having to do a different sumifs for each row?
I've tried:
Assuming I'm on D4...
=SUM(IF(A:A=$A4, B4+C4))+IF($A3=$A4, D3)
Which will work for the first few, but once there is another source, this formula doesn't work.
Should I be using an OFFSET() function?
Formula:
=SUMIF($A$1:$A1,$A1,$B$1:$B1)+SUMIF($A$1:$A1,$A1,$C$1:$C1)
Use this in your example sheet to get the result you want.

Logical calculation in Excel

I need advice/help. I am working on calculation in excel where I have data like mentioned below.
. A B C D E F G H
1| A275 A277 A273 A777 A777 TOTAL A222 GRAND TOTAL
2| 5 7 4 3 4 7 7
Now, I want to count row 2 based on the header.
Here is the condition.
If A1 <> B1 then take A1, if B1 <> C1 then take B1, if C1 <> D1 then C1, so on.
But tricky part is...
If D1<>E1 then D1 else (if E1<>F1 then E1 else (if F1 = "TOTAL" then F1 else(if F1<>G1 then F1)))
In short H2 should have 30 and not 37.
Added comments:------------------------------------
So, Basically if A1<>B1 then take A1 but if A1=B1 then take B1, but then for B1, its a same rule like if B1<>C1 then take B1, but if B1=C1 then take C1 and for C1, same rule. Stopping point will be "TOTAL". Along with these logic I need to check if any cell in row 1 is "TOTAL" then take value for same column. Now this "TOTAL" can be in any cell in row 1.
So from above table my calculation will be 5(A2) + 7(B2) + 4(C2) + 7(F2) + 7(G2) = 30
In this calculation I have not included D2 and E2 as D2=E2 so I took D2, here E2<>F2 so I should have taken E2, but as F2="TOTAL" so I took F2 and not D2 and E2.
I hope this make sense. (Sorry, I know its confusing.)
I have data in more then 100 columns.
Can this be achieved using Macro?
------------------------------------------------------------
Another pain point is data and header are dynamic, so I can't have a fix format. Logic should be in a way that can handle the dynamic data and header.
Any help or suggestion will be greatly appreciated.
I achieved the results you want with this.
Add a helper row. In cell A3 write this formula and drag it to the right:
=IF(OR(A$1=B$1,B$1="TOTAL"),0,1)
Calculate sum in say cell H4 (not H2 because if the formula refers to entire row 2 there will be circular reference):
=SUMIF($3:$3,1,$2:$2)

Resources