I have a cell value like 100/20. I mean this text equals "5". I want to calculate each cell and get sum on bottom.
I calculate a cell like this (just for a cell)
=LEFT( V342;FIND( "/"; V342 ) - 1 ) / RIGHT( V342; LEN( V342) - FIND( "/"; V342 ) )
How can i calculate and sum all cells ?
You can use array version of SUM (confirmed with Ctrl+Shift+Enter):
=SUM(LEFT(A1:A6, FIND("/",A1:A6,1)-1) / (MID(A1:A6, FIND("/",A1:A6,1)+1,50000)))
Or SUMPRODUCT confirmed with Enter:
=SUMPRODUCT(LEFT(A1:A6, FIND("/",A1:A6,1)-1) / (MID(A1:A6, FIND("/",A1:A6,1)+1,50000)))
With data like :
In A1 through A3, in another cell enter:
=SUMPRODUCT(--LEFT(A1:A3,FIND("/",A1:A3,1)-1)/(MID(A1:A3,FIND("/",A1:A3,1)+1,9999)))
In your locale use ; rather than ,
Related
Here is what I did
=VLOOKUP(M3,P2:Q23,2,FALSE)+VLOOKUP(N3,P2:Q23,2,FALSE)
I want to sum the values with just one formula and not repeat it
Im using Excel Online
I tried =XLOOKUP(M2:N2,P3:P23,Q3:Q23) but I get a value error,does anyone know how to do this ?
Perhaps you can try in Excel Online:
• Formula used in cell C3
=SUM(SCAN(0,M3:N3,LAMBDA(x,y,VLOOKUP(y,P3:Q12,2,0))))
Works for me in Google Sheet as well
• Formula used in cell C3
=SUM(SCAN(0,M3:N3,LAMBDA(x,y,VLOOKUP(y,P3:Q12,2,0))))
This works if, and only if, you are certain the M2 and N2 will not be the same value:
=SUMPRODUCT( ( (P2:P23=M2) + (P2:P23=N2) ) * Q2:Q23 )
If you want N2 = M2 to be valid and result in the number added twice, then:
=SUMPRODUCT( (P2:P23=M2) * Q2:Q23 ) + SUMPRODUCT( (P2:P23=N2) * Q2:Q23 )
But then you are back to repeating the formula.
I used M2 and N2 for the lookup values; your post uses row references 2 and 3 sometimes interchangeably.
Giving static numerical values to the ROW() formula like ROW($1:$2)) works perfectly (obviously), but I have both the values it requires in cells... Here what I am trying to build : ROW($C3:$E4)). This works, but gives me the value 3 (C3 cells's row).
What should I do in order to get the value inside C3 cell to pass it to ROW()?
For Excel 365:
If we enter:
=ROW(7:13)
in D1, we get:
Now if G1 contains 7 and G2 contains 13, then:
=ROW(INDIRECT(G1 & ":" & G2))
will give us the same result:
Don't use a volatile INDIRECT set-up when there exists a non-volatile alternative:
=ROW(INDEX(A:A,G1):INDEX(A:A,G2))
which is volatile only at workbook open.
In an Excel sheet, I want to add values A1, C1, E1 and so on.
I tried with
=IF(MOD(ROW(), 2) = 0, 1, 0)
I want to add values of H2,J2,L2,N2,P2 and all alternative cells.
Like that I2,k2,m2,o2 abd all alternative cells. Image attached.
Excel Image
One way of solving your issue is to use SUMPRODUCT.
=SUMPRODUCT((A1:L1)*(MOD(COLUMN(A1:L1),2)<>0))
Replace A1:L1 with the relevant range on your worksheet.
It will be better if you can provide some sample data and expected output next time :)
You need an array formula. (I'll use A1:E1 as the example range). First we need to assign either 1 or 0 to each cell.
Mod(Column(A1:E1),2)=0
Then we multiply each cell by that 1 or 0 to give either the cell value or zero as the result
a1:e1*mod(column(a1:e1),2)=0
Then we Sum them
=SUM(A1:E1*(MOD(COLUMN(A1:E1),2)=0))
and finally we enter this as an array formula by entering it using Control Shift Enter
Assuming that the range you want to add is A1:A10 try this FormulaArray
= SUM( $A$1:$A$10 * ISODD( ROW( $A$1:$A$10 ) ) )
or this if the range is A1:Z1
= SUM( $A$1:$Z$1 * ISODD( COLUMN( $A$1:$Z$1 ) ) )
There are similar requests, but not quite what i'm after. Take this example value:
aa;bb;cc;dd
The values between each semi-colon aren't fixed. They range from 3-15 characters. I need to pull the substring out from between the semi-colons.
I've got 'aa' and 'bb' sorted, but i'm struggling with 'cc' onwards. Here are my first two formulae:
=LEFT(A1,FIND(";",A1)-1)
...get values to the left of the first semi-colon
=MID(A1,
(FIND(";",A1)+1),
FIND(";", A1, (FIND(";",A1) + 1))-(FIND(";", A1) + 1))
...get values between the first and second semi-colon. Stuck at the third (wish I could use variables.. JSON perhaps?)
The end goal is to split out a multi-choice column into 5 columns for Power BI reporting. We want all of the computation done and dusted before it hits the report; I know there is a split on delimiter option in Power BI.
Any assistance would be much appreciated, thanks.
P.S. Tagged in Excel since Sharepoint apparently uses the same formulas, and that's what i'm testing in at the moment.
I can't assure you to work it in sharepoint but it will work on excel. Try below formula.
=TRIM(RIGHT(LEFT(SUBSTITUTE($A1,";",REPT(" ",100)),COLUMNS($A$1:A1)*100),100))
As per below screenshot, put the formula in B1 cell then drag to right as needed.
There are dozens of ways of doing it just with formulas. Without going to anything too esoteric and without resorting to array formulas you could use something like:
=TRIM(MID(SUBSTITUTE($A3,";",REPT(" ",LEN($A3))),(COLUMN(F:F)-2)*LEN($A3)+1,LEN($A3)))
Try this:
Create a header row where your fields will be split out to, numbered from 1 to 5 (in cells B1 - F1). These #s will be used in the formula.
The 2nd row will have the start of your data (in cell A2). In cell B2, enter this formula:
=TRIM(MID(SUBSTITUTE($A2,";",REPT(" ",LEN($A2))),(B$1-1)*LEN($A2)+1,LEN($A2)))
Then you can use the fill handle (+) to copy it across from B2 to F2.
Reference: https://exceljet.net/formula/split-text-with-delimiter
Beautified version of the formula:
=TRIM(
MID(
SUBSTITUTE(
$A2,
";",
REPT(
" ",
LEN(
$A2
)
)
),
( B$1 - 1 ) *
LEN(
$A2
) + 1,
LEN(
$A2
)
)
)
And for 1-time interactive passes, you can use Excel's built-in delimiting: Go to Data -> Text to Columns and walk through the wizard.
I'm looking for a way or ideas (preferable array solution), where you can determine if the numbers in a row increases.
The excel formula should give me "True" for the following sequence, since I want it to exclude #N/A values.
Example:
0,22 0,275 0,3162 0,36 #N/A 0,46 0,52
Notice:
I saw an reddit post "Formula to detect if row values are increasing?" with a similar question. I liked the idea and I have tried to use it with my numbers, but don't get the formula to work/understand it fully.
I am not sure if it can be done in one array formula, because the possibility to have N/A values causes some additional complexity. I can suggest a solution with a helper column though. Say your list of values is in A1:A7, then you can get the sign of the difference between the value in A2 and the value in A1 as follows:
= IF( ISNUMBER( A2 ), SIGN( A2 - LOOKUP( 2, 1 / ISNUMBER( A$1:A1 ), A$1:A1 ) ), 0 )
if you put this formula in B2, you can drag this down to B7. Now if you compare the sum of B2:B7 with the number of increases you expect, you have your answer:
= SUM( B2:B7 ) = COUNT( A1:A7 ) - 1
Refer to this very helpful page to get an explanation of how to get the last non-blank (c.q. numeric) value in a range.