Excel Comparing Multiple Columns - excel

I have a spread sheet that has computers in the furthest left column with their specs in columns B - L. There are a lot of extraneous computers in this list I don't need to work on, so I wrote a little Python script to pull out the bad values from the computer list (what was in column A). I then inserted a column to the left of column A (so what was in A is now in B and the good values are in A). I basically need to keep column A as it is, make column B match it and also remove the corresponding specs of the computers I don't need to worry about, but keep everything sorted so I know what specs go with what computer I need to work. Is there any way to do this in Excel?
thanks

Vlookup should do the trick
Assuming the current source data looks like this:
A A 1 2 3 5 6
D B 7 8 9 10 11
F C 12 13 14 15 16
D 17 18 19 20 21
E 22 23 24 25 26
F 27 28 29 30 31
G 32 33 34 35 36
and desired output is this
A 1 2 3 5 6
D 17 18 19 20 21
F 27 28 29 30 31
On a new sheet to keep it clean
Assuming SHeet1 has your current data
in Sheet2 column a Sheet4!A1
in Sheet2 column B VLOOKUP(Sheet4!B1,Sheet4!$B$1:$G$7,2,0)
VLOOKUP(Sheet4!B1,Sheet4!$B$1:$G$7,3,0) for column C and etc
dirty and tedious, but should work.

I think you should try adding data into columnA (new) based on whether the (new) columnB values feature in the good list (elsewhere), say with MATCH. If they do not #N/A should be returned and that might be used to filter on and delete what is visible.
If your 'good' list is in Sheet2 column C you might try:
=MATCH(B1,Sheet2!C:C,0)
copied down to suit.

Related

When column number cycles to first number alter column B with new id

I have a list of numbers that I need to map across two columns. Column A has a list of numbers that repeat every 1400 records, eg.
A
B
C
12
12
12
428
12
6
12
12
14
14
14
14
12
12
12
12
12
14
14
14
I need to auto fill column B based on column C's data.
Column B should look like:
A
B
C
12
12
12
12
12
428
12
12
6
12
12
12
12
14
12
14
12
14
12
14
12
12
428
12
428
12
428
12
428
12
428
14
428
14
428
14
428
Is there a formula that I can use to accomplish this? Column C has multiple records that I need to map to column A.
Every time Column A "REPEATS", in this case when 12 comes around again, I want column B to populate with the next number. In this case 428 then 6 ect.
If the number of the repeated elements is always the same you can just divide the row number by that and index the elements in the C Column accordingly.
I.e. you have the sequence 12,12,12,12,12,14,14,14,14,14 which is of size 10. Then you can do this for the entries in column B:
=INDIRECT(ADDRESS(QUOTIENT(ROW()-ROW(B$1),N)+1,3))
Here ROW() is the row value of the cell. I supposed your numbers started from cell A1 and B1, otherwise you need to replace ROW(B$1) with the starting cell. The $1 prevents the 1 to increment when you drag the list. Then, you take the quotient of that value with N, where N is the size of the sequence, in your case it is 10. The quotient gives you the integer part of the division. To that number you need to add 1, since excel starts indexing from 1 and not from 0. Then you need to find the reference for the right address of the values you want to put in column B, this is done with ADDRESS(ROW_NUMBER,COLUMN_NUMBER), where COLUMN_NUMBER here is 3, since C is the third letter. (Change accordingly if you use a different column for the input) The ROW_NUMBER is the number we calculated. INDIRECT(ADDRESS) is a function that puts the value of the address that we got with the ADDRESS function.
This should work if your sequence of 12s and 14s is always of the same length. Otherwise, I suggest you leave excel and start using some programming language, such as python.

count and sum function not properly working

I am working in excel and for some reason my sum or count function is not working properly. Or, perhaps I am not using the correct function or in the right way.
A B C D E F G H
February Max March Max
1 28
2
3
4
5
7
11
15
17
19
22
23
25
IF(SUM(A:A>0),28,"")
IF(SUM(E:E>0),31,"")
I have the above columns, I want the Max columns to show a specific number only if there is data in their respective month column. February has data, so it shows 28. March does not have any data so it shows no max. I need to look at the entire column or at least a large area (row 2 to row 2000).
The issue I am having is that if I do not have a value in the first row, but do have values in later rows, the sum or count function will to recognize that and will return zero.
A B
February Max
3
4
5
7
11
15
17
19
22
23
25
IF(SUM(A:A>0),28,"")
I have tried both sum and count functions, neither are giving me the results I want. I have also tried making >= 1. I found from StackExchange that someone was having a similar problem and a solution was to change the cell format to a number. That did not work either. Any suggestions?
Per my comment, you could use COUNTA() which checks if a cell is blank.
While it doesn't answer the technical reason SUM/COUNT isn't working, it should work for your intended purposes.
=IF(COUNTA(A:A)>0,28,"")

Identify Rows with Same Values in 2 Different Columns

I have a data set of roughly 405,000 rows and 23 columns. I need the records where the value in column "D" is the same as the value in column "H" for that row.
So for
A B C D E F G H
13 8 21 ok 3 S - of
51 7 22 no 3 A k no
24 3 23 by 3 S * we
24 4 24 we 3 S ! ok
24 9 25 by 3 S # we
75 2 26 ok 3 S 9 ok
etc...
I'd get back the 2nd row, the 6th row, etc...
A B C D E F G H
51 7 22 no 3 A k no
75 2 26 ok 3 S 9 ok
Based on other posts like: Formula to find matching row value based on cells in multiple columns I tried using a Pivot Table, but it complains I can't put either of my two columns in the "Columns" area because there is too much data. With both columns in the "Rows" area, I get a relationship of D to H, but I can't then find a way to filter on only those where D = H.
I've also looked into countifs(), vlookup, and index / match functions, but I can't figure this out. Help please.
I would do a simple "IF()" formula in a new column.
For your example add a new column I and use the following formula in the first data row (I2):
=IF(D2=H2,"Yes","No")
Fill down to the end of the data.
Then using Excel filters or countif you can check the number of "Yes" vs "No" in your data.

Rolling Time LookBack Calculation

I'm sorry if this has been answered. I've been searching around for awhile now.
I have a times series dataset that I need to perform calculations on based on the previous x time (last hour,day, etc).
My issues is that I don't know how to run these calculations since the time deltas are not standardized.
Example:
Column A - Time (in seconds lets say)
Column B - Value
Time Value Result(5)
01 3 0
02 5 3
04 4 8
07 8 9
09 6 12
13 4 6
14 4 10
15 1 8
22 9 0
33 7 0
How could I return the Result(5) column by summing the last 5 seconds from that one instance (row) (not including it)?
Thank you.
EDIT:
To clear up what I'm trying to do:
1) Find the previous 5 secs of data using column A and return that range of rows
2) Using that range of rows for the 5 previous secs, sum column B
3) Output in Column C (formula)
The following formula should do what you need (paste into C2 and drag down):
=SUMIFS($B$2:$B$11,$A$2:$A$11,">="&A2-5,$A$2:$A$11,"<"&A2)
Where YourTime is the time in the row you wish to look back and sum over.
I've tested and it works for the data you provided - expand the ranges as appropriate.

select min value in B column for same values in A columns excel?

I would like to get e.g. min or max value from column2 for same value in column1.
In mine example I want max value from column2 for value A (column1) and that is 18, and for B is 27.
I've tried with array function but I cannot manage it to work properly.
Tnx for any tip or solution.
Example:
Column1 Column2 Max_value
A 1 18
A 5 18
A 18 18
A 3 18
A 4 18
B 2 27
B 5 27
B 18 27
B 27 27
B 5 27
B 3 27
Sorry for poor example, but I couldn't post picture, my rank is not high enough :)
The standard "array formula" is like this for C2
=MAX(IF(A$2:A$100=A2,B$2:B$100))
confirmed with CTRL+SHIFT+ENTER and copied down column - adjust ranges as required
replace MAX with MIN to get the minimum values in the next column
This is a cinch with pivot tables. Here's one way to do it.

Resources