Reference a cell in oo using a value of another cell - openoffice-calc

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"

Related

Google Sheets - IF columns contains text and another columns contains number return total value of number column

I am trying to see if I am able to get the hours from one column only if it matches a word that is another column.
For example in the sheet link attached, if the word is Operations (Column A) I want to get the sum of all the hours (Column B) that correlate with that word.
https://docs.google.com/spreadsheets/d/1-1QCZsNTZ5xDcDryv8qg0YPtsoY3Erjz7ZNGUXds7HY/edit
Hope this makes sense.
Thanks in advance.
you can use:
=SUM(IFNA(FILTER(B:B,A:A=E1)))
OR
=SUMIF(A:A,E1,B:B)
Cell E1 has the word selection in the sample here

Suming multiple cells that may not be number

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.

Remove duplicates and Keep related data Calc (Excel)

I have a list of products in calc (excel), each with an associated IP address. Many of the names have multiple IP addresses, however they are organized one column at a time. I am trying to remove all of the multiples and pull all of the IP addresses under a single name. I have tried nslookup and index match, they do not deal well with multiple outputs though. Right now it looks like this
a| 1
a| 2
a| 3
b| 1
b| 2
b| 3
etc...
I would like it to look like this
a 1,2,3
b 1,2,3
Is there any way to do this without wasting a ton of time, I have a few ways that work but they will take me forever to setup.
I recommend setting up your formulas in multiple "helper" cells before getting to the final "result cell". This breaks down the problem into smaller steps that are more easily formulated and, if needed in the future, updated. Once the setup is complete you can hide the helper columns by right-clicking on the column letter and choosing "Hide".
The first column to set up is the list of distinct product names. For the formula below to work, the product/IP list will need to be sorted in ascending order. If the list is not already sorted, to sort it first highlight the entire list, including headers. Then choose Data→Sort; select sort by "Product", make sure the radio button "Ascending" is selected, and press OK.
For purposes of this example, I'll assume product names are in column A, starting on row 2 and IPs are in column B starting on row 2 (with row 1 being the header labels). In the column where you want to list the distinct product names (I used column D), enter in the top cell =A2. In the cell below enter
=INDEX($A$2:$A$13;MATCH(D2;$A$2:$A$13;1)+1)
The match formula has a 1 as the third variable, meaning the range is sorted ascending and MATCH will return the position of the last matching cell. We add 1 to the position of the last matching cell, and this will be the position of the first cell with a new product name. That position is fed into the INDEX function to show the next product name.
Copy and paste that cell down as far as you need to show all the product names.
Now we'll set up a series of cells to display each IP address. I used columns F to I to show up to 4 addresses:
=IF(MATCH(D2;$A$2:$A$13;0)<=MATCH($D2;$A$2:$A$13;1);INDEX($B$2:$B$13;MATCH($D2;$A$2:$A$13;0));"")
=IF(MATCH(D2;$A$2:$A$13;0)+1<=MATCH(D2;$A$2:$A$13;1);INDEX($B$2:$B$13;MATCH(D2;$A$2:$A$13;0)+1);"")
=IF(MATCH(D2;$A$2:$A$13;0)+2<=MATCH(D2;$A$2:$A$13;1);INDEX($B$2:$B$13;MATCH(D2;$A$2:$A$13;0)+2);"")
=IF(MATCH(D2;$A$2:$A$13;0)+3<=MATCH(D2;$A$2:$A$13;1);INDEX($B$2:$B$13;MATCH(D2;$A$2:$A$13;0)+3);"")
MATCH with the third variable of 1 returns the position of the last matching cell; MATCH with the third variable of 0 returns the position of the first matching cell.
The IF statement checks if the position of the first matching cell (in the first lookup column) or the cell below that (in the second lookup column) or the cell two below the first match (in the third lookup column), etc. is less than or equal to the position of the last matching cell. If yes, then it looks up the relevant IP address. If no, it displays a blank.
In the formulas above you would need to manually enter the formula in the top row of each column. If you have some products with a large number of IP addresses, you may want to set up the formula so you can copy and paste between columns as well as down the rows. This would work if you were starting in column F:
=IF(MATCH($D2;$A$2:$A$13;0)+COLUMN()-6<=MATCH($D2;$A$2:$A$13;1);INDEX($B$2:$B$13;MATCH($D2;$A$2:$A$13;0)+COLUMN()-6);"")
Once you have your top row set up as you want, copy and paste down however many rows you need.
If you want to combine all the IPs into a single cell separated by commas, you can use a formula like this:
=CONCATENATE(F2;IF(G2<>"";","&G2;"");IF(H2<>"";","&H2;"");IF(I2<>"";","&I2;""))
Each IF statement will add a comma separator followed by the cell contents if the checked cell is not empty, otherwise it returns a blank string. You will need to manually adjust to add additional IF statements for however many maximum columns you want to concatenate. Again, once you have the top row set up, copy and paste down however far you need.
Assuming you have two columns (A and B), that these are labelled and sorted as shown, then enter in C2:
=IF(A1<>A2;B2;C1&","&B2)
and in D1:
=A1<>A2
Copy both down to suit, select ColumnC and Copy, Paste Special... with each Selection ticked other than Paste all and Formulas, click OK.
Select ColumnsA:D, Data > Filter > AutoFilter, click Yes and select 1 for ColumnD and all visible range.
Copy and paste into a new sheet, move B1 to C1 and delete Columns B and D.

Count specific character in a cell in openoffice calc

I have a cell with some text content.
For example: "Red, shirt, size,"
I need to count how many times the comma is used in this cell.
The result should be "3"
Any ideas?
You can use the following formula: LEN(Cell)-LEN(SUBSTITUTE(Cell;"YourCharacter";""))
In your case, the formula would be: LEN(Cell)-LEN(SUBSTITUTE(Cell;",";"").
LEN(Cell) does the following: Counts the number of characters in your cell.
LEN(SUBSTITUTE(Cell;"YourCharacter";"")) counts the number of characters in your cell without the character ",". By subtracting the second formula, you get the number of occurrences of your character.
You can use LEN() function as below
=LEN(cell)-LEN(SUBSTITUTE(cell;",";""))

VLOOKUP. I have read and followed the directions for VLOOKUP, but I cannot get it to work.

I have read the other questions regarding Vlookup. I have my formula, but it is not working. I have a column of Zip-Codes in column e. I want to look for a matching zip-code in column m and then replace it with the county in column n. Please can you help me? Here is the formula:
=VLOOKUP(E2:E7807,M2:N962,2,false).
I have also tried using just 1 cell (E2) at the beginning of the formula instead of a range (E2:E7807).
Try below in the first cell.
=VLOOKUP(E2,$M$2:$N$962,2,false)
and copy and paste this cell in all required range of cells.