Same row different column. Excel Formula - if-statement

If is possible with the if(indirect formula to give me the value from the same row but from a different column if a specific cell is from that row?
More specific: I want cell =Sheet2!F23 to give me =Sheet1!N11 if =sheet2!C23 is from Sheet1!B11.
The important thing is the I need it to come from row 11 but from a different column.
Thanks in advance.

I did the following:
On Sheet 1 i gave all the rows a unique number in column A
On sheet 2 i just put in the unique number(C23) and the rest of the cells on that row used the formula below with. The only thing i needed to change was the index of which column needed to be matched.
It might not be the most efficient way but i worked for me.
=IFERROR(INDEX(Sheet1!B:B;MATCH($C23;Sheet1!$A:$A;0));"")

Related

Cannot separate columns

I'm having an issue with calculated columns.
When I select a date in the slicer, i want two columns to show in my matrix: the selected date and the same period last year. I have calculated columns to do this, but when I select them, this is what happens:
Instead of having 2 columns, one stays above the other. Does anyone know why this happens? How can I change it?
Thank you so much in advance.
Sílvia
It looks like in the "Matrix" Visualization, you have "abr2015" and "abr2014" in the Columns Section. Move them to the Values section and you should get what you are looking for.

Grouping by multiple columns and aggregating all values

I am rather new to Power Bi and I have a question i can't find the answer to.
I want to import a table that have some label columns, with repeated items, and more than 15 data columns.
My desire result would be to group the label columns, so no repeated items, and aggregate the values of the remaining columns.
Is there a way to do that in PQ editor or DAX ?
I appreciate any help or direction you can give me!
A sample of the table (it's much bigger, with multiple values in the first three columns)
Table Sample
Thanks a lot
Edit: From that sample, the output y I want is the following
Output Sample
The thing is, there are many different values in the first columns, and i need to agreggate all the other values, keeping they column name (cause this info is already linked to other files).
Maybe the only way is to group by and add the columns, renaming them one by one?
I want to do this in a couple of files, so if you know of another way please let me know!
In your query designer import your table. Then go to Home > Group By and group like you want it, the same goes for the aggregations and thats it.
If you just want to remove row duplicates, just group all columns which you dont want to aggregate and the rest can be aggregated like you want it.

How to alternate values of a =textjoin range in spreadsheets

first of all excuse my poor English, I'm trying to get the exact words to summarize my problem.
I'm trying to make a formula to concatenate a big range of cells by alternating its crossed values.
If you see the image, I have some titles (3rd row), and some variable values for each column from B to D, in the rows 5 to 7. The number of columns and rows will expand in actual project. Then, I need to summarize all crossed data to make some processes later: I need the output written at column F, where I get the title and then the cell value.
If I use =TEXTJOIN(",";;"$B$3:$D$3;B5:D5) I get the output at H5, but It makes me to get many problems later at processing information.
I have tried to make some extra columns or cells concatenating content of each "title" and "value", and then, joining everything, but it's a poor solution if I'm trying to build a sheet with hundreds of columns. I'm sure there would be another better solution, but I can't figure out by now.
your formula should be:
=ARRAYFORMULA(SUBSTITUTE(REGEXREPLACE(TRANSPOSE(QUERY(TRANSPOSE(
IF(B5:D<>"", ","&B3:D3&","&B5:D, )),,999^99)), "^,", ), " ,", ","))

Comparing arrays using IF - How to get rid of empty spaces in final result?

I have 2 columns in Sheet 1 (named Projects), "Projects" in column A and "Status" in column B. The number of rows is dynamic.
In Sheet 2, I want to extract the projects that meet a certain string criteria and populate a table. For example, if the Status is "Operating", take the project name in column A for that row and put it in a table.
I tried =IF(Projects!B1:B="Operating",Projects!A1:A,"") but it returns the names of the projects in the same row position as in Sheet 1. So if there is a 2 row gap in Sheet 1 between two operating projects, it keeps the 2 row gap in Sheet 2.
How do I get rid of the gaps?
There are some ways to accomplish this.
First solution - based on code you have provided
Your code: =IF(Projects!B1:B="Operating",Projects!A1:A,"")
After some tweaks (working):
=FILTER(
ArrayFormula(IF(Projects!B1:B="Operating",Projects!A1:A,"")),
ArrayFormula(IF(Projects!B1:B="Operating",Projects!A1:A,""))<>""
)
As a bonus - you need this code only in one cell
Picture:
Second solution (elegant and fast one)
You need only this:
=QUERY(Projects!A1:B,"select A where B='Operating'")
Picture

OpenOffice Calc: Counting unique strings in cell range

I'm trying to find a way to calculate the number of unique strings in a single column, excluding blank cells. So far I've seen solutions such as the following:
=SUM(1/COUNTIF(X2:X99;X2:X99))
Plus another similar formula using FREQUENCY instead of COUNTIF. However, applying this to my spreadsheet gives me a decimal value that has no apparent meaning. For example, if my column contains 20 cells containing "ABC", and 30 cells with "XYZ", I should have an output value of 2. However, this is not the case, and even I can clearly see that the above formula won't output anything larger than a 1, which has left me rather confused as to its usage.
Pivot tables seem to show the most promise, but I can't get that to work either. Here's what I tried:
Select the column, including the header
Select a new pivot table and use the selected range
Drag the header from Available Fields to Row Fields
Select the ignore empty rows option
Create the table
This then creates a table with one row per unique entry in the first column, and an empty second column. One row below is a Total Result cell, with the adjacent cell empty.
From this, I can see that there must be some sort of capability of the software to find unique strings, so it would stand to reason that there must also be a way of counting them and displaying that value in a cell. The question is, how do I do that?
Your first attempt should work if (a) wrapped in SUMPRODUCT and (b) the range does not contain blank cells:
=SUMPRODUCT(1/COUNTIF(X2:X51;X2:X51))