Transpose multiple rows into Single Column - excel

I have a range B2:Y194 of which I need to transpose from a row into a single column in cell A196, How would I go about doing this please?
I have tried this formula from another site but not quite sure how to tailor it to work on my range
=OFFSET($B$2,ROUNDUP(ROWS($2:2)/3,0)-1,MOD(ROWS($2:2)-1,3))

Here is an example as like you asked, please change the references as per your data requirement.
Formula Used in A1: =INDEX($C$2:$AA$671,1+INT((ROWS($A$1:A1)-1)/COLUMNS($C$2:$AA$671)),1+MOD(ROWS($A$1:A1)-1,COLUMNS($C$2:$AA$671)))
If this one not suits for your requirement, please let me know along with screenshot of
your data by modifying your question again.

Related

Excel: how to move “answers” rows into under column “questions”?

How do I move answers from other column to same question under another column, can any one guide the exact formula to achieve this? See example below what needs to be achieved as shown in picture.
With having the data as posted in your example, use the following formula in A10:
=IF(OR(OFFSET($A$1,ROUNDDOWN((ROW()-7)/3,0),,,)=A9,OFFSET($A$1,ROUNDDOWN((ROW()-7)/3,0),1,,)=A9), IF(OFFSET($A$1,ROUNDDOWN((ROW()-7)/3,0),1,,)=A9,"",OFFSET($A$1,ROUNDDOWN((ROW()-7)/3,0),1,,)),OFFSET($A$1,ROUNDDOWN((ROW()-7)/3,0),,,))
But there may be a simpler way..

Why using worksheet name in formula makes it fail after sorting?

I'm looking for any documentation or explanation for something that happens in Excel and I think it's a bug, unless somebody can throw some light in this.
Recreate this fail is very easy:
The above data is in a worksheet named Hoja1.
First column are typed values.
Second column is a formula like this: =Hoja1!A2 and drag down
Third column is a formula like this: =A2 and drag down.
I know the formula in second column wouldn't be the proper way (no need to reference the worksheet name if you are referencing cells in same worksheet), but it's needed to check this behaviour.
Now, just sort data using first column as criteria (order from min to max). I was expecting formulas would still show the most left cell value, but see what happens:
I was not expecting that at all. I tought that because I've used relative references in =Hoja1!A2, it would be increasing row number. but not at all. Formulas look like this:
Solution to this is easy, I must use clearly notation excluding worksheet name when referencing cells in same worksheet, but this behaviour is wrong for me.
I've search on Google, Microsoft Forums and also SO and found nothing about this behaviour when referencing cells in same worksheet using worksheet name.
As I said, I know the solution, but I was expecting somebody share any info about this issue.
That's all. Thanks in advance.
This is a known bug/feature/"by design" - eg see:
https://answers.microsoft.com/en-us/msoffice/forum/all/excel-table-with-formulas-wont-sort-properly/56a70898-bee5-4226-8d96-72f05f49eb11

Excel formula - Get first occurrence of partial string in rows above cell

I have a table of fruits in Excel 2013.
I'd like to fill the "Category" column by searching from the current row to the top until the first occurrence of "::", which is the keyword for a category in the table.
If there was some way to reverse a range, I could do something like "=Match("::*"; $A6:$A$2)" to find the row. However, this is not possible.
Does anyone know how this might be accomplished using formulas?
Using your provided sample data, and assuming your data is already organized as shown in your sample, you can take advantage of that organization and use this formula in cell C2 and copy down:
=IF(LEFT(A2,2)="::","",IF(LEFT(A1,2)="::",MID(A1,4,LEN(A1)),C1))
Assuming your table is in A1, put this in C3:
=INDEX(A:A, AGGREGATE (14,6,ROW($A$1:A2)/(LEFT($A$1:A2,2)="::"),1))
And copy down.
Here's a kinda different approach. I'm just basically responding to this part of your post to prove this is possible:
If there was some way to reverse a range, I could do something like "=Match("::*"; $A6:$A$2)" to find the row. However, this is not possible.
Reversing a range is possible, it's just tricky.
As you pointed out: $A6:$A$2 won't work since this is equivalent to $A$2:$A6.
However, without getting into the nitty-gritty details, this array formula will reverse this range:
= INDEX($A$2:$A6,N(IF({1},MAX(ROW($A$2:$A6))-ROW($A$2:$A6)+1)))
Note this is an array formula, so you must press Ctrl+Shift+Enter instead of just Enter after typing this formula into a cell.
You could use this in combination with your MATCH formula to get the desired result (which tells you how many rows up the :: row is):
= MATCH("::*",INDEX($A$2:$A6,N(IF({1},MAX(ROW($A$2:$A6))-ROW($A$2:$A6)+1))),0)
(Also haha this is kinda cool: Usually you see MATCH used within INDEX to effectively get a VLOOKUP type of functionality. This is the first time I have ever seen it the opposite way of having INDEX within MATCH.)
Note that I'm not saying this is necessarily the best approach for this specific problem, just proving a point that arrays can be reversed.

Converting IF statements for use in SUMIF/COUNTIF [or conditional formatting] Excel

I've been trying to get to grips with SUMIF & COUNTIF functions in Excel recently, with limited success. I've realised the crux of the problem is that help pages give far too specific examples, including the official Office support.
I already know how to put together complex tests with multiple criteria already, using IF statements. What I really need is a guide to how to convert IF statements for use in such functions.
The real issue for me is what happens to cell references? I have a column of cells, each with some value for a given property. With an IF function I can go into the adjacent column, test the neighbouring cell using some criterion or set of criteria to find its value for a given property, and return an appropriate answer. I click and drag my formula down to check all the cells.
Eg. A1:A10 are the cells I'm testing. The property I'm checking is their length, whose value will be the number of characters. The appropriate answer will be whether the number of characters is above or below a threshold.
Put together; IF(LEN(A1)>50,"above","below")
Pasted into B1 and dragged down to B10 I get an array of answers.
Suppose I want to count all the cells which meet the condition, that's where I'm stumped. COUNTIF looks like I could just specify the range (A1:A10) and condition LEN(A1)>50 and get my answers. But what do I put inside LEN()? I want to go through and check for each cell in the range, how can I specify just one? Specifying none: LEN() or the range LEN(A1:A10) won't work.
For highlighting cells (conditional formatting), it's easy, just put the top left cell of the array, so LEN(A1), but that doesn't work either!
I hope that's made the problem clear. Obviously I could just have
IF(LEN(A1)>50,1,0) in B1:B10, and SUM(B1:B10) in C1 or something, thus counting all the cells which match the criteria in the if statement. But that seems like a totally retrograde step which negates the benefits of COUNTIF entirely. Namely that it saves space and reduces complexity in the sheet by doing away with intermediate steps.
And I have at least 1 sheet for which that definitely won't work owing to the volatile nature of my array sizes; I wouldn't be able to fit the additional intermediate columns if I wanted to!
SO, can any IF-statement-style check be converted to work with COUNTIF/SUMIF, if so then how, and are there any other tips you could include in case someone with a similar problem comes searching? Thanks so much for answers and help!
Use SUMPRODUCT:
=SUMPRODUCT(1*(LEN(A1:A10)>50))
COUNTIF/SUMIF do not like it when you try to modify the range to be tested. You can do a lot with the criteria, but not the range. It is what is given up to use it in a non array form.

Excel formula to prevent duplicate name entries

I am creating a work chart for a project with excel table. However with so many people to manage I have ran into an issue of often putting same person twice on different columns of the same row (he/she can't work on two places at same time!)
So, I am looking for help with a formula that notices if the same name appears twice on a row but does not count multiple blank cells as duplicates. My understanding of excel is very basic and so far I have managed to get this far
=COUNTIF(A6:W6;A6:W6)=1
which returns to me with false, which I assume is because of the blank, unfilled cells still within the table being counted as duplicates.
Help would be appreciated, thanks.
You can't have a range as the second argument of a Countif. The range you pass into the formula will resolve to just the first value. Use the Evaluate Formula tool to see what I mean.
If you want to determine if ANY name in the range A1:W1 appears more than once (and exclude blanks), you will need a recursive function. That can only be done with VBA, not with a formula.
You could use a Countif in a conditional format to highlight duplicate names in a row. That's a piece of cake. Pipe up if you want to do that.

Resources