Excel - Skip Blank Table Cells Formula - excel

I have a table being created via an XML map so it has a lot of blank cells in each column. It looks like:
| Name | Stat 1 | Stat 2 | Stat 3|
| Test | | | |
| | Four | | |
| | | 5 | |
| | | | 102 |
Basically each row has only one value and I am trying to transpose it onto another worksheet where all the values are one row like this:
| Name | Stat 1 | Stat 2 | Stat 3 |
| Test | Four | 5 | 102 |
In my searching I found this formula:
=IFERROR(INDEX(Table9[#name],SMALL(IF(Table9[#name]<>"",ROW(Table9[#name])-ROW(Table9[#name])+1),ROWS(A2))),"")
I set that and in A1 of another sheet and drag it down and it does return the populated cells but it is also returning 0 for all the blank cells instead of skipping them until it has a value to return.
There may be a better way to do this so I am open to other options but would prefer to avoid vba if possible.
Thanks.

Let's say input sheet is called Sheet1 and the Name is in cell A1 on both sheets. Then use following formula for Name on output sheet:
=INDEX(Sheet1!A:A,(ROW()-2)*4+2)
and for Stat 1:
=INDEX(Sheet1!B:B,(ROW()-2)*4+3)
and so on ... more generally:
=INDEX(
input_column_range,
(ROW()-first_row_in_output)*number_of_columns + first_row_in_input+column_index
)

Related

Excel search multiples rows containing substring

I have an Excel file with 2 sheets :
The first one got a list of keywords in a column.
The second one got sentences on a column along with an id on another column.
Thus the 2 sheets look like this :
Sheet 1: Sheet 2:
A A B
| the | | 15587 | The cat is walking |
| cat | | 94683 | No one here |
| ... | | 47222 | The TV is on |
| 59378 | No cat allowed |
| ... | ... |
What I want to do is to put on the B column of sheet 1 the list of sentences ids where the keyword is found. So here I'll get on sheet 1 :
A B
| the | 15587;47222 |
| cat | 15587;59378 |
| ... | ... |
Do you know how I can achieve this using functions ? I tried VLOOKUP but it only returns the first occurrence and I don't know how to use FILTER with an operator to check if the sentence contain a string.
Thanks
You could try:
Formula in E1:
=TEXTJOIN(";",,FILTER(A$1:A$4,ISNUMBER(SEARCH(" "&D1&" "," "&B$1:B$4&" ")),""))

How can I use a formula so every second row is empty?

I have two sheets inside Excel like this:
*Sheet 1*
| 20 | | |
|----|---|---|
| 21 | | |
| 22 | | |
| 23 | | |
*Sheet 2*
| Referenz | |
|----------|---|
| 21 | |
| | |
| 22 | |
| | |
| 23 | |
I would like the output in sheet 2 as shown. Now I tried leaving space between the cells by dragging it down, but it doesn't work as expected. I also had a look at INDEX but it is not what I'm looking for.
Can you please help me?
Assuming your data is in cells A2:A4 on the first sheet and you want the output on second sheet starting from second row, you can try following formula in sheet 2 row 2:
=IF(ISEVEN(ROW()),INDEX(Sheet1!$A$2:$A$4,CEILING(ROW()/2,1)),"")
Edit:
If I have understood what you need correctly then you can use a formula like
=Sheet1!A2&CHAR(10)
Copy down...!
Try this:
=IF(ISEVEN(ROW());A2+1;"")
Should give you the following result:
In case you want the rows that are uneven, just switch the "value_if_true" and "value_if_false" of the IF() formula.

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.

Kind of group by in Excel without VBA

I need another transformation help in Excel
| A | B |
---| ----|--------|
1 | ID | Course |
2 | 1 | A1 |
3 | 1 | A2 |
4 | 2 | A1 |
5 | 3 | A2 |
I want to have a kind of group by, i.e.
| A | B | C |D | ...
---| ----|---------|---------|---------|----
1 | ID | Course1 | Course2 | Course3 | ...
2 | 1 | A1 | A2 | | ...
3 | 2 | A1 | | | ...
4 | 3 | A2 | | | ...
Any ideas? Is it possible without VBA macro?
I believe that the following link on removing duplicates from column would suit your needs (in your case you would do it horizontally).
http://www.get-digital-help.com/2009/03/30/how-to-extract-a-unique-list-and-the-duplicates-in-excel-from-one-column/
Per your reply to Robert, if you want to do it without VBA, try this... Select all cells in the first column. Copy and paste them into the first column of another worksheet. Use Excel's Remove Duplicates function on the pasted data. Then use INDEX functions in the columns to the right in order to pull the first, second, etc values matching that first column value.

Resources