List of x/y values from a table in excel - excel

I have a table in excel that contains values in row 1 x1,x2...xn and values in column A y1,y2...yn. I need to populate column A in another spreadsheet with values "x1/y1", "x1/y2"..."xn/yn". Is there a way to do this without creating a script in VBA? Until now I was using just =Sheet1!A2&"/"Sheet1!&B1 and draging it down and right and then manualy copying results to column A but as the table grows it becomes quite troublesome.
EDIT:
Let me rephrase it so it could be more understandable my Sheet1 looks like
| x1 | x2 | ... | xn |
y1 | | | | |
y2 | | | | |
...
yn | | | | |
now I need to populate column A in Sheet2 so it would look like
x1/y1
x1/y2
...
x2/y1
x2/y2
...
xn/yn
Is it more understandable now?

You can use a couple of Index formula to do this
=IF(ROW() <= COUNTA(Sheet1!$A:$A) * COUNTA(Sheet1!$1:$1), INDEX(Sheet1!$1:$1,INT((ROW()-1)/COUNTA(Sheet1!$A:$A))+2)&"/"&INDEX(Sheet1!$A:$A,MOD(ROW()-1,COUNTA(Sheet1!$A:$A))+2),"")
Starting at Sheet2!A1 and copy down for at least the number of entries in the table. Any excess formula will show blanks.

Related

Find in which columns lies the text?

Thanks for reading this!
Lets say we have 2 columns in this workbook called "Data":
| Column A | Column B |
| -------- | -------------- |
| Joshua | Noah |
| Daniel | Joshua |
In another workbook, I want the user to input some random name in a cell.
Below that cell, I want to be able to show him/her, in which column that name lies. E.g. if he types "Joshua", I want to be shown below:
||
|--|
|Column A|
|Column B|
I prefer using a formula, instead of VBA, as it would mess with my not-so-experienced end-user!
Notes: See below my attempt if you find it useful:
(1) I tried that using a nested IF + FILTER functions inside, but the IF returns only the first TRUE column, like this:
| |
|------|
| Column A |
| Column A |
Here is my actual formula, where I'm referring to split ranges in sheet "6", where I have 4 columns:
IF(NOT(ISERROR(FILTER('6'!B4#,ISNUMBER(SEARCH($F$4,'6'!B4#))))),'6'!$B$1,
IF(NOT(ISERROR(FILTER('6'!D4#,ISNUMBER(SEARCH($F$4,'6'!D4#))))),'6'!$D$1,
IF(NOT(ISERROR(FILTER('6'!F4#,ISNUMBER(SEARCH($F$4,'6'!F4#))))),'6'!$F$1,
IF(NOT(ISERROR(FILTER('6'!H4#,ISNUMBER(SEARCH($F$4,'6'!H4#))))),'6'!$H$1,""))))
You could use:
Formula in D2:
=FILTER(TRANSPOSE(A1:B1),MMULT(--(TRANSPOSE(A2:B3)=D1),SEQUENCE(ROWS(A2:B3),,,0)),"")
You can get the column numbers with this formula (original data on worksheet "10")
=AGGREGATE(15,6,1/('10'!A:D="Joshua")*COLUMN('10'!A:D),SEQUENCE(COUNTIF('10'!A:D,"Joshua")))
Although I suggest reducing the range references from full columns to something shorter to reduce calculation times.
With Office 365, you can convert the column number to the letter with this:
=LET(col,AGGREGATE(15,6,1/('10'!A:D="Joshua")*COLUMN('10'!A:D),SEQUENCE(COUNTIF('10'!A:D,"Joshua"))),
adr,ADDRESS(1,col,2),
"Column " & LEFT(adr,FIND("$",adr)-1))

Google Spreadsheet - Sum cell value if another cell contain one of N strings

As shown on this Google Spreadsheet I would like to SUM a list of currency values from a column only if in the row of the value I have one of the selected strings from a list.
| Tag | Value |
| : | : |
| Goo | 12$ | <= SUM value because I have Goo or Boo
| Dee | 3$ |
| Boo | 4$ | <= SUM value because I have Goo or Boo
| Yoo | 7$ |
| : | : |
| Result | 16$ |
I didn't found a way to do that, is that possible?
You can just sum two SUMIF() functions together.
=SUMIF(A:A,"Goo",B:B) + SUMIF(A:A,"Boo",B:B)
Assuming that A:A contains the words to match and B:B contains the values to sum.
To be more specific to your issue, you will actually have to modify your range so you are not getting any circular reference errors (since the cell is in the same column as your sum range)
So, if the cell that contains your formula is in row 25 (for example), then something like this should work:
=SUMIF(A1:A24,"Goo",B1:B24) + SUMIF(A1:A24,"Boo",B1:B24)
=ArrayFormula(SUMPRODUCT((A2:A5=({"Goo","Boo"}))*(B2:B5))) - SUMIF has a lot of inherent limitations, you would do well to read something about array formulas.

Excel: retrieve data based on a column

I have an excel document with a checklist like this one:
| number | yes/no | notes |
| 1 | yes | blablabla |
| 2 | yes | twinkle twinkle |
| 3 | no | little star |
I'd like to "echo" the fields which are set as "no" (in the second column) in another sheet, echoing the columns "number" and "notes". The result of my example would be:
| number | notes |
| 3 | little star |
How could I do it? Thanks!
Assuming your Main Table is in Sheet2, range A2:A4 (row 1 being headers). Use this formula, as an array (enter with CTRL+SHIFT+ENTER) in your sheet 2:
=INDEX(Sheet2!A$2:A$4,SMALL(IF(Sheet2!$B$2:$B$4="No",ROW(Sheet2!A$2:A$4)-ROW(Sheet2!A$2)+1),ROWS(Sheet2!A$2:A2)))
This will return all the Numbers. To get the Notes, change the very first index range to Sheet2!C$2:C$4. Obviously adjust your range down as necessary (I doubt you only have 4 of these).
Finally, just wrap an IfError() around that, so it looks nice when you use it. As you add data to your table, your table of only "no" values will update.
=IfError(INDEX(Sheet2!A$2:A$4,SMALL(IF(Sheet2!$B$2:$B$4="No",ROW(Sheet2!A$2:A$4)-ROW(Sheet2!A$2)+1),ROWS(Sheet2!A$2:A2))),"").
edit:
Screenshots:
(Using the IfError([above formula],"") wrapper hides the #NUM results when there's no match.)

Powerpivot - Create flag if the row value of one column exists anywhere in another column

What I'm trying to accomplish doesn't seem too tricky, and should be doable I just can't seem to crack it.
All I need to do is create a calculated column that flags whether or not the row value in one column exists anywhere in another column within the same table.
id | Code 1 | Code 2 | Attempted results
--------------------------------------------------------------------------
1 | 1095829 | 1093895 | Y
2 | 1093895 | 1838949 | N
3 | 1095289 | 1093910 | Y
4 | 1093910 | 1840193 | N
So essentially, is Code 1 found anywhere in the code 2 column
You should be able to do this using an IF/MATCH formula. For example:
=IF(MATCH(B2,C:C,0),"Duplicate", "Unique")
This would check if B2 (1095829) shows up anywhere in the C column. If it does, it returns "Duplicate" to that cell, if it does not, then it returns "Unique".

EXCEL find the last relative maximum in a array (formula, not VBA)

I have a range containing values such as:
169.7978
168.633
168.5479
168.7819
167.7407
165.4146
165.1232
I don't need the maximum value of the range, i.e., the first cell in this example), but the last relative maximum, which in this case is the fourth cell. Is there a way to get this value without having to write a VBA macro? The formula must be general enough to work with a multiple number of maxima.
It may be a bit limited, but you may start somewhere as below.
Stated array in the OP is:
+----------+---+
| y | x |
+----------+---+
| 169.7978 | 1 |
| 168.633 | 2 |
| 168.5479 | 3 |
| 168.7819 | 4 |
| 167.7407 | 5 |
| 165.4146 | 6 |
| 165.1232 | 7 |
+----------+---+
Given this, you can find direct adjacency relative min/max with the following helper columns
Assign a Global_Rank helper column and look for y distro identical trend on both adjacent f(x) with the following formulas ( assuming your data is sorted by the x index )( formulas from Row 2 and filled down ).
RelativeMax:
=IF(AND(D2<=D1,D2<=D3),"RelativeMax","")
RelativeMin:
=IF(AND(D2>=D1,D2>=D3),"RelativeMin","")
Modify as needed. Hope this helps.
Edit:
Although...
If you're going to assume the data is ordered properly, you could also just use =IF(AND(B2>=B1,B2>=B3),"RelativeMin",IF(AND(B2<=B1,B2<=B3),"RelativeMax","")) and skip all the malarkey. This should work with multiple maxima/minima. Please report back with results from your dataset!

Resources