Spreadsheet: If row in sheet contains 2 criteria then get value of cell - excel

Sheet 1 gets values from Sheet 2.
Sheet 2 has hundreds of rows, but only 4 columns. (Cols A & C are names, Cols B & D are numbers).
Cell XX (sheet 1): Looks in Sheet 2, For "Bill" (col A) and "Jill" (col C) where they BOTH appear in the same row, then returns number from col B (from row where "Bill" and "Jill" are found) to Cell XX in sheet 1.
If "Jill" is in col A and "Bill" is in col C - then conditions are not met, and do not return value.
How do I write this?
I am so confused. PLEASE, someone help me?
Lookup Sheet 2 For "Bill" (Col A2:A300) AND "Jill" (Col C2:C300) Get number in Col B.

One solution is to create a helper column E. Use this formula in the first row (i.e. cell E1):
=$A1 & "-" & $A3
and fill this down for the other rows. If ColA = "Bill" and ColB = "Jill", then ColE will be "Bill-Jill".
You can then do a MATCH to find out with row has "Bill-Jill", and pick up the corresponding value from ColB:
=IF(ISNA(MATCH("Bill-Jill";e:e;0));"No match";INDEX(b:b;MATCH("Bill-Jill";e:e;0)))
The MATCH formula will find out which row contains "Bill-Jill", and the INDEX formula will pick up that row from another column. MATCH will return #NA if there isn't a matching cell, and this will be captured by the ISNA check.
I'm not sure if OpenOffice supports the MATCH function - it's definitely part of Excel though.

Related

Can you match or search with cell matching part of another?

I'm trying to create a formula in Excel where I can use an Index / Match formula where I'm searching for only part of one cell.
For example:
Sheet 1
Column A --> Full Name
Column B --> Removed status
Col A
Col B
Col C
Col D
Col E
1
Col D + Col E
Removed status
agent #
Agent F Name
Agent L Name
2
Sheet 2
Column A --> Sheet 1 Column B --> only if Sheet 1 Column A is part of Sheet 2 Column D
Column D --> Full Name 1, Full Name 2, Full Name 3
Col A
Col B
Col C
Col D
Col E
1
Sheet 1 Col B
AutoP status
Carged
Name 1, Name 2, Name 3
Notes
2
So, I'm hoping to get a formula to display Sheet 1 Column B into Sheet 2 Column A only if Sheet 1 Column A can be found as part of Sheet 2 Column D.
Is this even possible?
If you want to search for part of one cell, you can use find formula which search for given text within cell value find(text,withintext) and it return index that the text start with and error if not.
And if you need your process to be work line by line,
the final formula ( for row2 of sheet2 column A ) would look like this:
=IF(AND(NOT(ISERROR(FIND(Sheet1!A2,Sheet2!D2))),Sheet1!A2<>""),Sheet1!A2,"")
if row2 of column A of sheet1 is not empty and is found (no error returned);the value of sheet1 column A returned otherwise empty will returned.
Hope that was useful.

Copy values from cells from one sheet to another with MATCH and INDEX

Sheet 1:
Taxon names in column B
Sheet 2:
Taxon names in column A (range defined with the name "Taxon"; A:A)
Names of the parameters in columns C through L (range defined with the name "FeedingType"; C3:L3)
Values linked to the taxa in columns C through L (range defined with the name
"IndexArea"; C4:L1248)
Nature of data: Taxon names on sheet 1 & 2 are not ordered in the same manner, and the taxon names on sheet 1 is a subset of taxa names of sheet 2.
What I want done: I want to copy the values linked to taxa from columns C through L in sheet 2 to the same taxa in sheet 1 in the columns K through T.
So, if I have a "Hydra viridissima (Sheet 2, A6) somewhere in sheet 1, it should bring the values "5" (Sheet 2, J6 under "pre") and "5" (Sheet 2, L6 under "oth") to their respective cells in Sheet 1, which in this case would be in columns R and T.
What I have tried: Went through a tutorial and thought I had it with:
=INDEX(IndexArea,MATCH(B2,Taxon,0),MATCH($K$1,FeedingType,0))
It's not working, though it does identify when things are not matching exactly (#N/B).
I tried to add sheet2! in the formula in reference to names assigned to the ranges like this: =INDEX(Sheet2!IndexArea,MATCH(B2,Sheet2!Taxon,0),MATCH($K$1,Sheet2!FeedingType,0)), but gives the same error.
Can anyone help me out?
Thanks!
Your formula treats Taxon, FeedingType and IndexArea as defined names but your narrative doesn't mention them being assigned defined names. Try it as row and column references.
' in US-EN
=INDEX(Sheet2!$B:$M, MATCH($B2, Sheet2!$A:$A, 0), MATCH(K$1, Sheet2!$B$3:$M$3, 0))
' should the *FeedingType* come from column J?
=INDEX(Sheet2!$B:$M, MATCH($B2, Sheet2!$A:$A, 0), MATCH($J2, Sheet2!$B$3:$M$3, 0))

Sum of multiple columns if they match

I have this table of data:
A B C D E
003B1016 1 003G1016 1 003B1016
003G1015 1 003G1391 2 003G1015
003H0121 4 003H6208 2 003H0121
003H6209 1 003H6209 1 003H6209
I want to sum B+D if A and C are identical , how would i do that?
I have another 32000 rows of data. :) Thanks for the help
Put this in cell E1 and copy down:
=IF(A1=C1,B1+D1,"")
This says - if A = C, then add B+D. Otherwise, return blank "".
EDIT for new requirements
In order to add all amounts from column B where column A matches the current row and from column D where column C matches that row, where the row in column A exists anywhere and the row in column C exists anywhere, do the following formula in E2 and drag down:
=IF(ISERROR(MATCH(A2,A$1:A1)),IF(ISERROR(MATCH(A2,C:C,0)),"",SUMIFS(B:B,A:A,A2)+SUMIFS(D:D,C:C,A2)),"")
This says: look above the current row in column A - have we seen this item before? If no, continue with the formula. If yes, ignore, to avoid double counting. Then, Look at all of column C - does the value in the current row of A occur anywhere in column C? If no, then don't add anything. If yes, Add all items from column B where column A matches the current row, and add all items from column D where column C matches the current row.

How to concatenate columns in excel using a formula having conditions?

I want to concatenate columns A, B, C and D in column E. But the concatenated cell should contain the data of all the columns with some extra text.
e.g. Suppose column A contains "11/01/1997", B contains "ABC", C contains "20" and D contains "B+". Then E should contain "DOB: (data of A column), Name: (data of B column)" and so on.
Unless I have misunderstood:
In the top row with data in (could be row 1 or row 2 if you have headers on the data)
Put = "DOB:" & A1 & ", Name: " & B1 ...
(Substitute 1 for 2 or whatever row you are on)
Drag this formula down the e column - this should do it for each row.
Ok?

Identify matching numbers and then imput a value from a different column

I have two sheets, Sheet1 and Sheet2. Sheet1 has a list of company names in column A, Revenue in column B and a unique number identifier in column D (also seen as "unique #forAAA in Sheet2). In Sheet2, I pulled a list from Hoovers, and the format comes up something like below (so this format should not be changed).
Column A B C D
Company Name Place Type of Comp Revenue
1 AAA US HQ 10.0 M
2 unique #forAAA
3 BBB India Branch 5.0 M
4 unique #forBBB
What I'd like to do is match the unique number for each company between Sheet1 and Sheet2 and then put the revenue # from Sheet2 into column B of Sheet1 which corresponds to the correct #. I'm pretty lost here, so any help or ideas would be great. Thanks for your help!
Because the unique identifier is on a different row than the result to be returned, you can use a variation using INDEX and MATCH:
=INDEX(Sheet2!D:D, MATCH(D2, Sheet2!A:A, 0)-1)
INDEX will return the value within range Sheet2!D:D on row MATCH(D2, Sheet2!A:A, 0)-1.
MATCH(D2, Sheet2!A:A, 0) will give you the row number where the unique ID is found, then -1 to get the row number of the revenue amount.
EDIT: As per comment, to remove the M, you can use this:
=TRIM(SUBSTITUTE(INDEX(Sheet2!D:D, MATCH(D2, Sheet2!A:A, 0)-1),"M",""))
I would put the unique value in a column inserted before A (would be the new column A) instead of putting it below each row. Then, in the other sheet I'd put the VLOOKUP like this:
=VLOOKUP(D2,Sheet2!A:E,5,0)
That should return the value in column E (column D before the column insertion, i.e. revenue for the unique company identifier).
Note that the third argument in the vlookup function is the number of the column you want to be retrieved, so the range defined in the second argument (Sheet2!A:E) should contain that column.

Resources