copy data from one sheet to another - excel-formula

Excel 2010: I'm trying to copy data from one sheet to another sheet using criteria 1: the cell in column a is not blank, and criteria 2: the cell in column b is a specific value. I tried the IF and VLOOKUP functions but end up with blank rows inbetween. All ideas will be greatly appreciated.
Part of current spreadsheet:
A B C
1 CD_WR CD_STATUS CD_RQMT
2 1000 90 120
3 1001 50 110
4 1002 80 785
5 1003 60 612
Sheet tabs are: Main, Status 50, Status 60, Status 70, etc.

1.Apply both of your criteria
2.Color the selection to some color (say "yellow")
3.Remove the filter
4.The Sort as per Color yellow(all yellow cells shall come together)
5.Copy all the yellow cells
6.Paste them to another sheet
If you want the original order in the original sheet to be maintained,then.
1.Create a column with Sr.No and have a serial number in chronological order for all line itemss.
2.Perform step 1 to 6 as above
3.Sort as per ascending order in the Sr.No

Related

How can I assign a value to a cell by referencing a seperate table in Excel/Mac Numbers?

Table 2
Pts
# of tix sold
0
100
1
200
2
300
3
400
4
500
5
600
Example: In Table 1 Tim sold 198 tickets. He didn't make it to 200 tickets sold, so he gets 0 pts. Bill sold 220, so he gets 1 pt. The points show in the cell next to the name on Table 1, but references table 2.
I tried using xlookup and index, but I don't really know what I'm doing.
XLOOKUP provides several matching modes, and one is "exact match or next smallest" which is what you want. If the lookup value is 225, I want it to start down the list, and if it finds 225, it selects that row; if it encounters any number > 225 then it knows it's gone too far and selects the previous number. This sounds like the logic you want.
Assume:
Tim's ticket count is in B2, and you want his points in C2;
The lookup table is on a second worksheet, titled "Table2";
The lookup table headers are A1:B1, and the data is the 6 rows below that;
The lookup table should be in ascending ticket count order.
Then, in table1 cell C2 place this:
=XLOOKUP(A2, table2!$B$2:$B$7, table2!$A$2:$A$7, "", -1)
And copy it down the rows of column C.
The -1 argument tells lookup "exact match or next smallest".

Excel Index Match Sumifs

I have a table of data where column headers are account numbers, and I'm trying to sum all data for a specified account when one column (left hand column) equals a certain number.
724| 453 | 345
1 90 0 2
2 91 1 3
3 80 5 4
So would like a formula that would sum account 453, or 345 if values in first column are less than 2. I've written an index/match function to find the column for a specified fund. But can't seem to add in the sumif or sumifs to help sum. if there is a better way, please help.

compare 2 excel columns with data in adjacent columns

I have seen a few answers which were close to what I am looking for, but can't quite figure it out. I apologize as I am not a programmer, but am tasked with these types of things periodically.
I have a spreadsheet with data in multiple rows. I would like to compare column A with C and have them align, and then the data in B move with column A. (I can rearrange the columns if need be to make this work.
I have this:
Inventory ID# count Original ID# vendor item number
1234 2 1000 vendor 1 1234566
1456 1 1234 vendor 2 546564
7000 3 1456 vendor 3 af4566
2003 vendor 4 56778
7000 vendor 1 788asd
What I want it to look like is after:
Inventory ID# count Original ID# vendor item number
1000 vendor 1 1234566
1234 2 1234 vendor 2 546564
1456 1 1456 vendor 3 af4566
2003 vendor 4 56778
7000 3 7000 vendor 1 788asd
I have tried macros, and VLOOKUP, but can't figure out how to have the count move with the inventory ID # Thank you for your help.
I'll assume your data starts in Sheet1!A1
Move the Invenotry ID# and count columns to a different sheet (say, Sheet2). Then replace the value in cells A2 with the following:
=IFERROR(VLOOKUP($C2,Sheet2!$A:$B,1,FALSE),"")
and similar for cell B2:
=IFERROR(VLOOKUP($C2,Sheet2!$A:$B,2,FALSE),"")
Fill it down. The VLOOKUP will place your id's and counts in the right rows, and the IFERROR( ... ,"") part will put a blank string where there is no match, so it will look like you desired table
If your data starts from cell A1, insert 2 columns C and D like below,
Enter the below formula in cell C2 and drag it right to column D and then down throughout the range,
=IFERROR(INDEX($A:A,MATCH($E2,$A:$A,0),COLUMN(A1)),"")
You can then copy-pastespecial Column C and D to A and B and delete C and D.

Excel - Remove duplicates and SUM at the same time

I have a column with ID's, but they are duplicated; for instance:
"0,0,1,1,1,2,3,3,4,4, ... "
For each row, I have a given value in the other columns, for instance:
"0-24; 0-36; 1-13; 1-34; 1-23;..."
I want to keep only one row with each ID but I need to sum the values of each ID, that is, sum all the values in all columns for a given ID (0,1,2,...), which may include several rows.
Is there a easy way to do this using Excel?
Here is some sample data (table to the left) together with the desired output (tables to the right).
ID Value ID Value
0 24 0 60
0 36 1 70
1 13 2 16
1 34 3 24
1 23 4 48
2 16
3 9
3 15
4 24
4 24
What you can do is to copy your IDs and paste them for example in another Sheet. Let's assume your original table is in Sheet1, and you copy all your IDs to column A in Sheet2.
Then you remove duplicate IDs in Sheet2:
Select column A > Data Ribbon > Data Tools > Remove Duplicates
In column B, you then put the formula:
=SUMIF(Sheet1!$A:$A, Sheet2!$A2, Sheet1!$B:$B)
Note: above formula goes into cell B2 on Sheet2, and you copy it down with pasteSpecial > only formulas.
Edit: if you still want the same number of rows etc because of the information in your other columns, just skip the "Remove duplicates"-part.

Removing specific rows in Excel

I have a data set in Excel as shown in the snippet below:
Patient Number Age State
1 20 1
1 20 3
1 20 2
2 35 1
2 35 4
3 62 2
3 62 1
3 62 3
3 62 4
3 62 5
I need to keep the last row of each patient, i.e. I need the dataset to look as follows:
Patient Number Age State
1 20 2
2 35 4
3 62 5
Is there a simple way to do this with Excel? Since the dataset is huge and cannot do it manually
If your data is in A:C columns, you can add another column with the following formula in D2:
=A2<>A3
Fill it down. Apply autofilter, choose False in D column and delete all filtered rows.
Edit:
This solution assumes your data is sorted by A column.
Enter below to D2 and press CTRL+SHIFT+ENTER to make it an array formula:
=MAX(IF($A$2:$A$11=A2,ROW($A$2:$A$11)))=ROW()
Advantage of this formula is PatientNumber column doesn't have to be sorted. Formula will find the last entry for each PatientNumber. See below, added one more row for Patient number 1:
You can easily keep the top entry with Data ► Data Tools ► Remove Duplicates. To keep the last entry, you first need to reverse the order.
In an unused Helper column to the right put a 1 in the top row then select all of cells in that column to the bottom of your data and use Home ► Editing ► Fill ► Series to gain a column of sequential numbers.
Sort your data using that new column in descending order.
Choose Data ► Data Tools ► Remove Duplicates using only the Patient column as the criteria for duplication.
Delete the Helper column as it is not longer needed.
Duplicates are deleted from the bottom up so the first value for each patient will be retained.

Resources