Suming multiple cells that may not be number - if-statement

I am struggling with this for a while and would like to receive your help. What I am trying to do is to sum the values of D column multiplied by value of E column, but not just sum elements of D and then multiply by sum of elements of E but first, multiply elements of each row, so for ex D2 * E2, D3 * E3 etc and then sum up result of multiplication of from each row. I tried to achieve this with arrayFormula and sum, but the problem is that in both column there may appear not a number, but character 'X', so the solution I created will not work. I was trying to use sumif alongside with arrayformula but it is not working and have no idea what to try to change to make this work. The formula I came up with is:
=ARRAYFORMULA(SUMif(D2:D24*E2:E24;"<>*X*"))
Example data:

try simple:
=ARRAYFORMULA(SUM(IFERROR(A1:A*B1:B)))

The below code works for me:
=ARRAYFORMULA(SUM(if(D2:D24="X",0,D2:D24)*if(E2:E24="X",0,E2:E24)))
I am using the if() function to check for occurrence of "X" within the array, and replace it with 0 if "X" is found.

Related

Is there a way to return value from an array if it is between two numbers?

Is there a way to fill in column B if the value in column A is between the numbers in column D and E? If the value is 41 then I want to return N/A since 41 is not in the range of numbers. Everything I tried just filled "Grape" since it was the closest and I don't want a long IF statement.
Lookup Value If Number Between Two Numbers
=LOOKUP(2,1/((A1>=$D$1:$D$5)*(A1<=$E$1:$E$5)),$F$1:$F$5)
IF you change your mind and don't wanna show #N/A then you can improve with e.g.
=IFERROR(LOOKUP(2,1/((A1>=$D$1:$D$5)*(A1<=$E$1:$E$5)),$F$1:$F$5),"")

I need to find links that contain the same number and merge them all into the same cell

can someone help me speed up the process in excel. I need formula to find links that contain the same number and merge them all into the same cell. So far I've done it with the formula but it's a slow process for me when I have over 1000 links:
=TEXTJOIN( ", ";TRUE;B110:B114)
Thanks!
Textjoin
I would use several columns.
Col B, extract the number from the strings with
=mid(A2,26,4)
Column C formula
=If(B2=B1, "", D2)
Column D
=IF(B2=B3, A2 & "," & D3, A2)
Copy those all the way down and answers with be in C. Filter out the blanks if you want.

Display each digit in a separate column in a row in Google Sheets

I have a column of data in binary values and I would like to split each digit of the number in the column into different cells across a row. How would I go about doing so? I saw the split function, but could not get it to work. https://support.google.com/docs/answer/3094136?
One of my example inputs:
1000111110100101111011110
1000110000100101000010000
try with this (you just change A2 to your cell):
=transpose(arrayformula(mid(A2,row(A1:offset(A1,len(A2),0)),1)))
For some rows (I limited text length with 30 char, you can change it):
=transpose(ARRAYFORMULA(mid(transpose(query(arrayformula(if(isnumber(A1:A)=true ,text(A1:A,"0"),A1:A)),"Select Col1 where Col1<>''")),row(A1:A30),1)))
try:
=ARRAYFORMULA(REGEXEXTRACT(A1:A, REPT("(.)", LEN(A1:A))))

Concatenate a range of cells in OO Calc

I have column A with these cells:
A1: Apple
A2: Banana
A3: Cherry
I want a formula that will string them together in one cell like this:
"Apple, Banana, Cherry"
I don’t know if it’s implanted on OpenOffice but on his cousin LibreOffice Calc since the version 5.2 you’ve got the function : TEXTJOIN
TEXTJOIN( delimiter, skip_empty, string1[, string2][, …] )
delimiter is a text string and can be a range.skip_empty is a logical (TRUE or
FALSE, 1 or 0) argument. When TRUE, empty strings will be ignored.
string1[, string2][, …] are strings or references to cells or ranges
that contains text to join.
Ranges are traversed row by row (from top to bottom).
Example : =TEXTJOIN(",",1,A1:A10)
More info here :
https://help.libreoffice.org/6.3/en-US/text/scalc/01/func_textjoin.html?DbPAR=CALC#bm_id581556228060864
A different approach, suitable for a long list, would be to copy A1 to B1, prepend a " and in B2 enter:
=B1&", "&A2&IF(A3="";"""";"")
then double-click the fill handle to cell B2 (the small square at its bottom right). The result should appear in ColumnB in the row of the last entry of your list.
As of version 4.1.7 of Apache OpenOffice Calc, there still isn't a simple solution to this problem. CONCATENATE doesn't accept cell ranges, and there isn't a TEXTJOIN function like LibreOffice. However, there is a workaround.
This is essentially a duplicate of pnuts' answer, but with images to hopefully help. His answer explicitly addresses separating the items with delimiters, as well as the opening and closing quotations, as the question above uses. As the general question (how to concatenate a range of cells) is useful to many people, I think my answer should still be useful even though I haven't done that.
In my case, I had one column with letters corresponding to finished worksets, and one column with letters corresponding to unfinished worksets. The letters only appear on every 8th row, so I can't view them all at the same time. I wanted to just mash all the finished letters together in one cell to be easy to view, and the same with the unfinished letters.
The example removes the 7 empty rows per letter and manually inputs which letters are finished/unfinished for convenience.
Column A is the "unfinished" column to be concatenated. Column C is used to perform the concatenation. Row 2 is the first row, and row 24 is the final row. G1 shows the concatenated result in an easy-to-see spot near the top of the document.
Columns B and D, and cell G2, utilize the same method to show the "finished" data. The formulas aren't shown here.
In cell C2, point explicitly to A2:
=A2
If you may have blanks, as I do, there needs to be a conditional in C2 to treat the first cell as blank text, instead of as zero Note 1:
=IF (A2 <> "" ; A2 ; "")
Then, in cell C3, concatenate C2 and A3:
=C2 & A3
Copy C3, then highlight C4:C24 and paste the formula to autofill those cells.
Wherever you need the result of the concatenation, reference C24.
Notes
Note 1 If N cells at the top of the A row are blank and you just let C2 = A2, the first N rows on C will show 0, and a single 0 will be prepended to the concatenation result. Here, columns B and D are used to illustrate the problem:
Either use the CONCATENATE function or ampersands (&):
=CONCATENATE("""", A1, ", ", A2, ", ", A3, """")
For something more powerful, write a Basic macro that uses Join.
EDIT:
There is no function that can concatenate a range. Instead, write a Basic macro or drag and drop CONCATENATE formulas to multiple cells. See https://forum.openoffice.org/en/forum/viewtopic.php?f=9&t=5438.

Reference a cell in oo using a value of another cell

I have two columns of numbers, and I want to make a 3rd column as the answer to the first two. I want to do this: in the third column call the row number of the first column using the second columns value.
Any help is greatly appreciated.
You can use the INDIRECT() function combined with CONCATENATE() to do this:
=INDIRECT(CONCATENATE("I";E1))
Here, i assume the resulting value is in column I, while column E has the row number.
The formula takes the string "I" and concatenates it with the content of E1. If E1 has the value "1", the resulting string is "I1". INDIRECT() uses that string as cell reference and returns the value of cell "I1"