Conditionally copy information from an Excel table to another sheet - excel

I have a table in an Excel sheet that is made up of 4 columns. Columns 2-4 have formulas in them. The 4th column has temperatures in it, and once it hits a certain temperature range I would like columns 1-4 (preferably) to copy over into another sheet.
How can I do that? I have tried to do a vlookup, but I don’t think it works because of the formulas in columns 3 and 4.

Do you have an example of data?
All i can think off is an lookup inside an 'If' statement
Eg.
| Column1 | Formula | Formula | Temperature |
| Text | text | text | 20 |
| Text | text | text | 25 |
| Text | text | text | 30 |
so maybe a helper column to the right
| Column1 | Formula | Formula | Temperature |Helper column |
| Text | text | text | 20 | 0 |
| Text | text | text | 25 | 1 |
| Text | text | text | 30 | 1 |
with the formula
=if(Temperature>"value","1","0")
=if(Temperature>"24","1","0")
Then use an if in your new column on different sheet saying
=if(Helper column = 1, column1, "")
In your new table
Hopefully that makes a bit of sense although it is tricky without seeing example data.
if you are ok with VBA this could probably be way easier to do!

Related

Excel Formula to Replace Numbers List with Default Text

Using Office 365 Excel
On a regular basis I download a csv file from a remote application, the file contains a column of unique numbers. There could be 50 rows in this column.
I would like to substitute these rows of numbers with text. Each number corresponds to a value e.g.
0 = car
421 = bus
12 = boat
I have a predefined text list of each number and it's corresponding value. Currently I'm doing a find and replace on each number to replace it with it's corresponding value' but it's very inefficient.
Is there a more efficient way I can achieve this, with some sort of saved formula that I can run each time I download the csv? When I download the default csv ideally i'd like to run some formula that I have saved, rather than copy / paste a lot of things between sheets etc.
An example below of the default csv (showing only three rows for brevity);
+-----+----------------+
| id | another column |
+-----+----------------+
| 0 | text |
+-----+----------------+
| 421 | text |
+-----+----------------+
| 12 | text |
+-----+----------------+
| etc | etc |
+-----+----------------+
I would like to run a formula that will replace the numbers with text like below.
+------+----------------+
| id | another column |
+------+----------------+
| car | text |
+------+----------------+
| bus | text |
+------+----------------+
| boat | text |
+------+----------------+
| etc | etc |
+------+----------------+
Any other suggestions are also welcome, however preferred method is via Excel.
You can do it only with Excel:
create a table into a new sheet/area where you can match ids and texts that you have to replace, i.e.:
( into a new sheet named 'MyTalbe')
A |B
0 | car
421 | bus
12 | boat
...etc etc
into your db create a new colum with this formula:
index( 'MyTable'!B:B; match(A1; 'MyTable'!A:A; 0))

Find rows in table that containing a value then get a value from those rows

I have a problem that I have tried to solve without any success. I am not so sharp in Excel.
I have a chart that looks like this (but with a large amount of rows):
| X | Text | Text | Value A (Ex. 342) |
| - | Text | Text | Value B (Ex. 745) |
| - | Text | Text | Value C (Ex. 642) |
| X | Text | Text | Value D (Ex. 147) |
Result: 489
As you see in row 1 and 4 they have a "X" mark in their cell A, that means that I want those rows values in cell "D" to add up in the cell "Result".
How can I do this? Appriciate answers and sorry for my bad english.

Excel Formula INDEX+AGREGATE+ORDER by another column

I have an excel formula that I need help with, since I'm not that savvy on excel.
The formula is the following:
=IFERROR(INDEX(Liste!$C$2:$N$10000,AGGREGATE(15,6,(ROW(Liste!$A$2:$A$10000)-ROW(Liste!$A$2)+1)/ISNUMBER(SEARCH("BOX"," " & Liste!$B$2:$B$10000 & " ")),ROWS($A$4:$A4)),COLUMN()-1),"")
This formula looks on another sheet (Liste) for lines containing the word BOX on column B and show them on "ROWS($D$4:$D4)" (in this case) starting from Column "C".
I'm not even sure if that formula orders the results on column "B" since they're all the same with the word "BOX".
It works prefectly, the only think I can't achieve (and I've tried diferent combinations) is to change that code to make it show the results in order according to column "C" (not column B).
Sample Data:
Sheet "Liste"
|-----------|----------|-----------|
| B | C | D |
|-----------|----------|-----------|
| NOTBOX | 5 | SAMPLE |
| BOX | 3 | SAMPLE |
| BOX | 1 | SAMPLE |
| BOX | 2 | SAMPLE |
| NOTBOX | 4 | SAMPLE |
|-----------|----------|-----------|
Current Result:
|-----------|----------|
| A | B |
|-----------|----------|
| 3 | SAMPLE |
| 1 | SAMPLE |
| 2 | SAMPLE |
|-----------|----------|
Desired Result:
|-----------|----------|
| A | B |
|-----------|----------|
| 1 | SAMPLE |
| 2 | SAMPLE |
| 3 | SAMPLE |
|-----------|----------|
Can someone give me a hand?
One thing I forgot to state is that I need to drag this formula around (rows and columns) so it's important that I can drag it on a large zone (if lines are added in the future) and that it ignores the errors (blank).
Thank you in advance
Here is an example on how you could do this:
Formula in F2:
=SMALL(IF($A$2:$A$6=$E$2,$B$2:$B$6,""),ROW(A1))
Or in French
=PETITE.VALEUR(SI($A$2:$A$6=$E$2;$B$2:$B$6;"");LIGNE(A1))
Formula in G2:
=INDEX($C$2:$C$6,MATCH(F2,$B$2:$B$6,0))
Or in French
=INDEX($C$2:$C$6;EQUIV(F2;$B$2:$B$6;0))
Note: The first formula is an array formula and need to be confirmed through CtrlShiftEnter.
Drag them both down and include an IFERROR if you drag these formula's down and you don't want to see errors once there are no more hits.

Excel function, exclude dates in chart data source

I am forming a chart from sheet A. Sheet B contains all my data.
I want to exclude a specified date(s).
Sample data:
+---+----------+--------------+--------------+-------------+-------------+-------------+
| | A | B | C | D | E | F |
+---+----------+--------------+--------------+-------------+-------------+-------------+
| 1 | Date | 29/03/2017 | 30/03/2017 | 31/03/2017 | 03/04/2017 | 04/04/2017 |
| 2 | Number 1 | -594590.4649 | -636666.4504 | 795637.1614 | 842563.4322 | 496463.9301 |
| 3 | Number 2 | 2189587.44 | 1301681.418 | 2080839.353 | 1945335.214 | 2421728.123 |
+---+----------+--------------+--------------+-------------+-------------+-------------+
The final output would be me excluding 30/03/2017 , and keeping the rest in my data selected for my chart.
the issue is that I want to maybe exclude a date in the middle of my selected range. But since this may be a hassle to input a long formula each time into my data selected. I would like to see if there is any formula/function to eliminate a specified date/column. Perhaps manually enter the column you want to exclude in a formula.
My current range is something like =Graph!$AB$5:$KA$7 But is there a function to exclude one of these columns?
I can manually select which dates with Ctrl but seems tedious.

excel return the value of a cell based on two other values

What I'm trying to do is a little complex but I think it's doable in Excel.
I have two worksheets in a workbook on sheet one I have this...
| Code1 | Code2 | Code3 | Code4 |
| BA1 | xxxxx | xxxxx | |
| BA2 | xxxxx | xxxxx | |
| BA3 | xxxxx | xxxxx | |
And on the second sheet...
| CodeA | CodeB | CodeC | CodeD |
| BA1 | 1 | date | text |
| BA3 | 1 | date | text |
| BA1 | 2 | date | text |
| BA2 | 1 | date | text |
| BA1 | 3 | date | text |
| BA3 | 2 | date | text |
| BA2 | 2 | date | text |
What I want to do is lookup Code1 on sheet one and find it in the second sheet in CodeA then find the highest CodeB for CodeA and then concatenate CodeC and CodeD and place them on Sheet one in Code4.
I hope that makes sense, Thanks for any advice.
I think I understand. Does this look correct?
Sorry for the swedish formulas but it's an array formula that you add with CTRL+SHIFT+ENTER.
The formula in english is:
{=MAX(IF(Data=A2,CodeB;-1))}
And the named range Data is Column H and I, and CodeB is Column I.
If it does not find the value it returns -1
Sorry noticed now that I only did half of the job.
Make another named range called Table that spans column I to K (Code B -> Code D).
And in column code3 add this formula:
=Vlookup(B2,Table,2,false)
And in code4:
=Vlookup(B2,Table,3,false)
And you should get:
This should find the results you are looking for.
This is an array formula so you will need to press CTRL+SHIFT+ENTER once you have entered it into the formula bar, this will have to done for every formula you add to the column.
As it is an array formula I have only written it to reference rows 1 to 18, you will need to update all references to include you last row.
Columns titled CODE1(to 4) are on the first sheet (Sheet 1)
Columns titled CODEA(to D) are on the Second sheet (Sheet 2)
=CONCATENATE(VLOOKUP(CONCATENATE(A2,MAX(IF(Sheet2!A:A=A2,Sheet2!B:B,-1))), CHOOSE({1,2},Sheet2!A1:A18 & Sheet2!B1:B18, Sheet2!C1:C18 ),2,0)," ",VLOOKUP(CONCATENATE(A2,MAX(IF(Sheet2!A:A=A2,Sheet2!B:B,-1))), CHOOSE({1,2},Sheet2!A1:A18 & Sheet2!B1:B18, Sheet2!D1:D18 ),2,0))
If you do not require a space between the dates, just remove " ", from the middle of the formula.

Resources