How to copy cell value only if other two cells matches - excel

I have an excel file containing two spreadsheet as shown below. I want to update value Comm Level in Sheet 1 with Comm Level in sheet 2 provided that Modem ID in sheet 1 matches Modem ID in sheet 2. How to do automatically do this in Libre office ? Can someone suggest me some formula or script which will work in Libre office as I do not have license for MS office.
Sheet 1
Modem ID | Comm Level
-----------------------
70000 | 90
70001 | 90
70004 | 90
70007 | 90
70010 | 90
Sheet 2
Modem ID | Comm Level
-----------------------
70001 | 80
70002 | 90
70003 | 60
70004 | 90
70009 | 90
Thanks

Assuming Modem ID is in A1 on both sheets. In C2 of Sheet1 and copied down to suit:
=IFERROR(VLOOKUP(A2,Sheet2.A:B,2,0),B2)
Looks for a corresponding value with VLOOKUP where a match exists and if not found defaults to existing value with IFERROR.

Related

Excel - Check if Value of Two Columns are new in a List and Passing a new ID to them

Good Morning,
I'm trying to formulate something in Excel that allow us to check if the value of two columns are new in a list, and if so, assign a new ID for them. If it's not, let it "Blank" or Assign the same ID that have been assigned before(Either way would work for me).
I'm trying to use something with Count.if, but it doesn't fit. As i'm thinking about this for some time, i decided to look for help.
What i want to do is a formula that solves the "Formula" Columns below:
Space|Name|*Formula*
1 | AB | 1
1 | AB | 1
1 | AB | 1
1 | CA | 2
2 | DD | 3
2 | EE | 4
2 | EE | 4
3 | SS | 5
3 | SS | 5
1 | ZZ | 6
1 | AB | 1
Sequential Numbering of Groups of Data
In cell C2 use the following array formula (Ctrl,Shift+Enter):
=IF(COUNTIFS(A$2:A2,A2,B$2:B2,B2)=1,MAX(C$1:C1)+1,
INDEX(C$1:C1,MATCH(1,(A$1:A1=A2)*(B$1:B1=B2),0)))
Then copy C2 and pastedown from C3 to the last cell.
If you're satisfied with just numbering each first occurrence then use the following formula:
=IF(COUNTIFS(A$2:A2,A2,B$2:B2,B2)=1,MAX(C$1:C1)+1,"")
Both solutions use the headers i.e. the headers must not be numbers.
If you don't mind non-sequential numbering, you can just return the index of the first match found as your identifier:
Copy into C2, then fill down as necessary. The match row stop may need alteration based on how much data you have
=MATCH(A2&"#"&B2, A$2:A$100&"#"&B$2:B$100,0)
Or as an array formula (only need to place in C2);
=MATCH(A2:A11&"#"&B2:B11, A2:A11&"#"&B2:B11,0)

Grouping excel files by Week Number

I am trying to work on a Excel that has a giant amount of data with dates, to simplify I want it to group the different numbers into weeks, allow me to explain:
The actual rows are like:
29-11-2018 | 49 | 1 | 4 |7 | 2
30-11-2018 | 49 | 4 | 0 |2 | 1
Where "49" is the week number from the date. I'm trying to make Excel put together those lines by week and add the other lines, like this:
49 | 5 | 4 | 9 | 3
And this for all the weeks, so I can know the exact number of data for every week.
Is there a way of doing this?
Thanks!
Regards,
Assuming your data is located at A2:F3..
H2 ---> =B2
put
I2 ---> =IF($B1<>$B2,C2,I1+C2)
and drag to L2, then
N2 ---> =IF($B3<>$B2,H2,"")
and drag to R2. Select H2:R2 and drag to the end..
you'll see your intended result in column N to R.

Obtain average based on multiple criteria from table column

I have a table that more or less looks like this:
Team_Name | Total_Errors | Total_Volume
_______________________________________
Sam | 3 | 1350
Sam | 5 | 1100
Jamie | 7 | 1600
Mark | 3 | 1220
Jamie | 10 | 2100
Mark | 5 | 1300
Sam | 5 | 1100
Jamie | 3 | 1900
Just with a lot more rows. I want to create a formula that calculates the average total_errors for just the numbers corresponsding to Team_names "Jamie" and "Sam".
How do I do this?
Something like Average(If(June(Team_Name)="Jamie","Sam"......?
(the table name is June)
thanks in advance
You can use Sum/Count:
=(SUMIF(A1:A8,"Jamie",B1:B8)+SUMIF(A1:A8,"Sam",B1:B8))/(COUNTIF(A1:A8,"Jamie")+COUNTIF(A1:A8,"Sam"))
I would go with a simple pivot table that uses June as a data source.
Put your Team_Name filed as a rows, and Total_Errors as Values. Change the Field settings of your Total_Errors to be an average, and change how many decimal points you want to see.
You can then apply whatever filters /Slicers you want and get your desired result.
Here's a screenshot (its on MAC, but you'll get the idea)
Assuming DATA in located at A1:C9 enter this formula at F5, note tat the Criteria Range used by the formula is locaed at E2:E4 (see picture below):
=DAVERAGE($A$1:$C$9,$B$1,$E$2:$E$4)

3 condition IF formula Excel

I'm looking to create an excel formula with 3 conditions.
Here's what I'm looking for:
D11 has a number (it is number of working hours). If the number is less than 4 (i.e. <=4), then I want it to show a value in cell B5,
If the number is between 4 and 8 (i.e. >4 and <=8), then I want it to show a value in cell B6.
If the number is over 8, then I want it to show a value in cell B7.
The cells in B5, B6 and B7 contain the relevant renimeration for 4-hours shift, 8-hours shift and for overtime.
This is what I have made:
IF(D11<4,"$B$5",IF(AND(D11>=4,E9<=8),"$B$6","$B$7")).
The Formula always gives a message :
"The formula you typed conains an error: - for information about fixing....;-to get assistance.....; - if you are not trying.......
Please advise!
I have tested and the follwoing is working for me:
=IF(B2<4,$E$2,IF(AND(B2>=4,B2<=8),$F$2,$G$2))
Here is the example of the data I was working with (replacing FORMULA with the above):
+-----+----------+----------+------------+-------------+-------------+-----------+--------+
| | A | B | C | D | E | F | G |
+-----+-----------------------------------------------------------------------------------+
| 1 | name | Overtime | Due | | | | |
+-----+-----------------------------------------------------------------------------------+
| 2 | bob | 4 | FORMULA | | 10 | 20 | 30 |
+-----+-----------------------------------------------------------------------------------+
Effectively if B2 is 4 then C2 should show 10.
Thank all of you. The problem was with the local settings that expect ; rather than , in Excel formulas.
Still I have problem with the formula, because I foud out that I should include one more condition: the case when the person is not working D11=0, because then he/she should receieve 0 or in the cell should be written a text "free day".

How to automatically delete rows in Excel

Consider the following (partial) Excel worksheet:
A | B | C | D
---+-------------+-------+-------
id | date | var_a | var_b
1 | 2011-03-12 | 200 | 34.22
1 | 2011-03-13 | 203 | 35.13
1 | 2011-03-14 | 205 | 34.14
1 | 2011-03-15 | 207 | 54.88
1 | 2011-03-16 | 208 | 12.01
1 | 2011-03-18 | 203 | 76.10
1 | 2011-03-19 | 210 | 14.86
1 | 2011-03-20 | 200 | 25.45
. | . | . | .
. | . | . | .
2 | 2011-03-12 | 200 | 34.22
2 | 2011-03-13 | 203 | 35.13
2 | 2011-03-14 | 205 | 34.14
2 | 2011-03-15 | 207 | 54.88
2 | 2011-03-16 | 208 | 12.01
2 | 2011-03-18 | 203 | 76.10
2 | 2011-03-19 | 210 | 14.86
2 | 2011-03-20 | 200 | 25.45
. | . | . | .
. | . | . | .
In reality, there are over 5.000 rows. I need to delete all rows which date falls on a saturday or sunday. In the example, March 12 and 13 (2011-03-12/13) and March 19 and 20 are Saturdays and Sundays. I cannot just delete every nth rows, since there might be days missing in the list (as is the case here with 2011-03-17).
Is this possible to do with either a formula or VBScript? I have never written a VBScript macro before (I have never had a use for it) so I would appreciate some help.
If you only need to do this once, this is what I would do. This should preserve the order, but if you're really worried about it, read very end of the post:
Add a new column, call it "Is Weekend". In it, put =if(WEEKDAY(B2, 2) > 5, 1, 0). Drag that formula down for the entire table.
Filter the columns. To do that, select the entire table (click on any table cell then hit Ctrl-A), then
On Excel 2007+, go to Data-> click "Filter"
On Excel 2003, go to Data->Filter->Auto Filter.
Sort everything by last column (Is Weekend) in descending order. This should put all weekend rows together without altering the order among the other rows.
Delete all rows with 1 in "Is Weeked" column. Delete that column.
If you're really worried about preserving order, before you do the above, you can do the following:
Add a new column called "Position". Put 1 in the first row, 2 in the second row, select them and drag it down to the bottom so every row has its own position number in increasing order.
Perform the filtering as above.
After you're done, sort everything in ascending order by "Position" column.
The trick is that you don't need to delete those rows, you need to replace their values for C and D with 0. This is easiest done with IF() and WEEKDAY() within two new columns C' and D' referencing C and D. Feel free to then just delete C and D.
You can do this in one go using an array formula. In cell E2, enter the following formula (on one line), and confirm with Ctrl-Shift-Enter (as opposed to the regular Enter)
=INDEX($A$2:$D$5000, SMALL(IF(WEEKDAY($B$2:$B$5000,2)>5, "",
ROW($B$2:$B$5000)-MIN(ROW($B$2:$B$5000))+1), ROW(A1)),COLUMN(A1))
5000 indicates the number of rows in your spreadsheet. After this, the formula should have curly braces around it to indicate it is an array formula. E2 should have the value 1. Then select cell E2 and drag the lower-right corner of the cell to the right until 4 cells are covered. Then drag the lower-right corner of the 4-cell-selection all the way down. At the bottom you will see rows containing #NUM!, one for each deleted row. You can delete those in the regular way.
In stead of starting off in cell E2, you could start off in cell A2 of a new sheet. In that case, you need to prepend the original sheet name to each reference in the formula, as in OriginalSheet!$A$2
This formula is an adaption from the one given in Excel: Remove blank cells
In case you decide to delete the rows, please make sure to run the VBA code from the last row to the first row. Here is a piece of code just written from memory to show you the idea of running from bottom to the top.
For i = Selection.Rows.Count To 1 Step -1
If WEEKDAY(Cells(r, 2),2) > 5 Then
Selection.Rows(i).EntireRow.Delete
End If
Next i

Resources