Excel help - Rearranging Columns - excel

So I need some help with excel.
What I have is in Black and what I need is in Red.
I have been able to rearrange column B to match column A and have it output in E but I need it to take the values in column C and D with it. This is what I have been using in column E:
=IF(ISNA(VLOOKUP(A1,$B:$B,1,FALSE)), "Missing", A1)
Can someone please help me figure out how to bring columns C and D with column B and populate them in F and G.
Any help is much appreciated! Thanks!!

You were pretty close - Since this is a dynamic range, I would suggest using the OFFSET() function from a specific location in your spreadsheet.
So, here's the formula you could paste into cell E1 and drag across / down to get the result you want:
=IFERROR(OFFSET($A$1,MATCH($A1,$B:$B,0)-1,COLUMN(A1)),"Missing")
Basically, what you're saying is:
If I get an error in matching the value I want, print Missing:
=IFERROR(MATCH($A1,$B:$B,0),"Missing")
Move a set number of rows from cell A1 based on where the numbers match with column A:
OFFSET($A$1,MATCH($A1,$B:$B,0)-1 ...
As I drag to the right, keep referencing the next column:
OFFSET($A$1,..., column(A1))
Hope that helps explain it.

Related

Excel IF A1 exist in column B, then C = D

I have an issue.
In excel I need If value from A column exit in column B, then I need to take value from C from same row as B and put it same row as A. I can do it manually but it is a lot of work for me. Maybe someone have formula, because what I was able to find it was only return true or false. Maybe someone know other tool to do it.
In D1 enter:
=VLOOKUP(A1,B:C,2,FALSE)
An error message will appear in D1 if the value can't be found. To avoid the error message use:
=IFERROR(VLOOKUP(A1,B:C,2,FALSE),"")
instead.

SUM/COUNTIF in excel 2013

I'm having some issues with a formula. In the formula I'm trying to sum the number of items in column E based upon the condition in column C.The formula I've used is, (which is working correctly.)
=SUM(COUNTIFS('Sheet1'!E:E,C86,'Sheet1'!C:C,{"A","B","C","E1","E2","F","G","X","T"}))
However in the next cell I'm trying go a bit further and trying to count the number of "Yes" and "NA" in column R based upon the condition in column E and Column C. The formula I've used is -
=SUM(COUNTIFS('Sheet1'!E:E,C86,'Sheet1'!C:C,{"A","B","C","E1","E2","F","G","X","T"},'Sheet1'!R:R,{"Yes","NA"}))
This time the formula is counting only "A" in column C and "Yes" in column R. It'll be great help if someone can point what mistake I'm making with this formula.
Thanks in advance!
Best Regards,
gmainak
Change 'Sheet1'!R:R,{"Yes","NA"} to 'Sheet1'!R:R,{"Yes";"NA"}
You can only do two arrays and one needs to be vertical ; and the other horizontal ,:
=SUM(COUNTIFS('Sheet1'!E:E,C86,'Sheet1'!C:C,{"A","B","C","E1","E2","F","G","X","T"},'Sheet1'!R:R,{"Yes";"NA"}))

Excel duplicate rows to CSV cell formula

I have an Excel spreadsheet such as this: (See Columns A through D of "Formula Output Column E" image - had to remove original 1st image due to not enough reputation points)
And would like to make a formula to consolidate it so that when the first three columns are duplicates, the last column gets combined into one CSV cell such as this: Excel Finish
I'm thinking it can get there with the right combination of Index and Match functions, but I haven't gotten it to work yet.... any help would be much appreciated! Thanks.
I currently have the following formula:
=IF(AND(A2=A1,C2=C1),"",D2&",
"&INDEX(A2:D17,MATCH(A2,A2:A17,0)+1,4)&",
"&INDEX(A2:D17,MATCH(A2,A2:A17,0)+2,4)&",
"&INDEX(A2:D17,MATCH(A2,A2:A17,0)+3,4)&",
"&INDEX(A2:D17,MATCH(A2,A2:A17,0)+5,4))
Which yields this ouput in Colum E: Formula Output Column E
As you can see, it either includes too many rows (Row 2 and 6 output) or too few (Row 8 output). Hope this helps, thanks.
If you have two extra columns and type
=IF(AND(A2=A3,C2=C3),D2&","&E3,D2)
in cell E2 and
=IF(AND(A2=A1,C2=C1),"",E2)
in cell F2 like in the following example
Then you will get the output for column CSV Output correct but in row F instead of row E, as below when you fill the formula to the bottom.
Here is the array formula (means you have to click Ctrl + Shift + Enter altogether) you can use in your CSV Output column:
{=IF(OR(ROW(E1)=1,MAX(--($A$1:A1=A2)*--($B$1:B1=B2)*--($C$1:C1=C2)*ROW($A$1:A1))=0),D2,INDEX($E$1:E1,MAX(--($A$1:A1=A2)*--($B$1:B1=B2)*--($C$1:C1=C2)*ROW($A$1:A1)))&", "&D2)}
Here is the explanation but I also included a picture for your reference:
Column F: This is to find the last matched row and this is also an array formula:
{=MAX(--($A$1:A2=A3)*--($B$1:B2=B3)*--($C$1:C2=C3)*ROW($A$1:A2))}
The -- just easy to see when you evaluate formulas. You can remove them if you want.
Column G: This is to concatenate the prior outcome:
=IF(OR(ROW(G1)=1,F2=0),D2,INDEX($G$1:G1,F2)&", "&D2)
Hope this helps. Please let me know if you have any question.

Excel Formula with IF... ELSE

Hi all,
I have this excel where by I need to find the location of the item if they are found in column B.
So In my F column, I tried to write ifelse formula which didnt work.which is
=IF(D2="NULL","NONE",C((D2))).
My idea is if D2 is not null, use the value in D column to find the location in C column. In this example, fish no 4, so it is found, my F column should show the value "C" using the value shown in D column and use it as Row no in C column
I hope you guys get the idea and help me out a newbie in excel. Thanks in advance
=vlookup($D2,$A$2:$C$6,3,0)
you can use that in column F. Place that formula in F2 and copy down.
you could technically use it in column E as well, but you would need to change the 3 to a 2.
you did not say what you wanted to do if the D value was "Null" so I am going to take a stab at the dark and wrap you lookup formula in an if statement that will deal with "Null" or empty cells
=IF(OR($D2="NULL",$D2=""),"",VLOOKUP($D2,$A$2:$C$6,3,0))
That is the alternative formula to place in F2 and copy down.
Use the formula:
=IF(D2<>"NULL",VLOOKUP(D2,A2:C6,3,FALSE),"Value is NULL")
Here is the working example:
Put formula in cell F2 and drag it down.
[edit]to pull proper location column, not just the row #[/edit]
Seems like a job for MATCH+OFFSET
Try this formula in cell F2:
=OFFSET($C$1, MATCH(E2,B:B,0)-1, 0, 1, 1)
Match is used to locate the value in the first argument (ie E2) within the range specified in 2nd argument (ie B:B). I use B:B but you could also use range B2:B30 or whatever more specific range you want. (I prefer the more generic B:B, though :) )
Third paramter "0" just indicates "Exact match".
This function will retun "#N/A" if nothing found.
OFFSET takes the result from MATCH to pick out the Location you want. The first parameter in OFFSET is the rows below (or above if negative) from the base row (in this case $C$1). the next is the column: 0 since we're in the column we want to be in. The last two are the size of the range: 1,1 is a 1x1 cell, so just 1 cell. If we did ...,2,3), that would be 2 rows high and 3 columns wide - or a 6 cell range. We're just after 1 cell here.
I've always preferred MATCH + OFFSET to other options, I just found they held up more robustly to changes in a sheet (ie new rows/columns added). So it's mostly personaly preference over VLOOKUP and INDEX. I honestly have never compared their actual performance, however, I've never had any issues with MATCH+OFFSET running slowly :)

How can I get excel match one cell to another set of values and print the values of third to a fourth?

I need some help with the following:
There is four columns one is first is imported the two others are standard info (list) and the fourth is what we need to export.
Can someone help me with this please???
I can't get excel to think something like:
Check if A4 matches any of C4 to C8.
If yes show the D cell next to the C cell in F4.
Sorry to be a pain, any help is much appreciated.
Thanks
Theo
Looks like a job for INDEX-MATCH. In F4:
=INDEX($D4:$D8, MATCH($A4, $C4:$C8, FALSE))
What this does:
Looks for an exact match (FALSE) of $A4 within the range $C4:$C8 and outputs the relative row index where it found the match.
Gets the value from the range $D4:$D8, in column 1 and the row it found in step 1.

Resources