Match cells of different values in different columns - excel

I am trying to figure out the following:
I have two columns ranging from A2:A316 and B2:316.
In column A I have the values A/A, A/T, or T/T. In column B
I have the values G/G, C/G, or C/C.
Is there a formula that I can write in a new column, that can find combinations
such as A/A in one column and C/C in another (in the same row). So that excel returns some value (e.g. 1) when it finds A/A in A and C/C in column B.
and 0 if its A/A or T/T in column A and A/T in column B. I want to find how many rows are A/A and T/T respectively (in column A) and G/G and C/C in col B.
Best regards,
Granit

It should be fairly easy to do this.
In Column C put something like...
In C1...
=IF(OR(AND(A1="A/A",B1="C/C"), AND(A1="A/A",B1="T/T"), AND(A1="A/A",B1="A/T")), 1, 0)
Just add more to the OR statement for the extra pairs.

=COUNTIFS(A1:A75,"A/A",B1:B75,"C/C")
this should do the trick for you it will count you all A/A C/C combinations in given range

Related

How to match up 2 columns with 2 other columns

In column A I have product id's and column B has the number of times the product in column A was quoted.
In column C I have the same product id's (but in different order) and column D has the number of times the product in column C was actually sold.
I want to match them up to add a final column in order to divide sales/quoted in order to get a value of efficiency in sales.
I believe it's an index/match/match but I'm not sure how to set it up.
Please help
Try
=B3/vlookup(A3,C:D,2,false)
In words: take the value in B3 and divide it by the value from column D where column C has the same text as A3.

Excel: Finding next equal match in column

I've googled for a solution to my problem for days and I just can't seem to get my head around how to do this.
I have 28 chickens and I track the eggs each one lays each month. My Excel sheet looks like this:
Current Egg-cel sheet
Column C is populated by the formula:
=LARGE($A$2:$A$29,$B1)
I'm using column B to increment the LARGE function
I want column D to populate with which chicken number laid the quantity in column C.
Obviously INDEX MATCH or VLOOKUP returns the first match for all equal values. How do I find the the next match? i.e.
Egg-cell sheet 2
I've seen similar questions and solutions but I for the life of me can not get it to work.
Use this formula in D2:
=INDEX(B:B,AGGREGATE(15,6,ROW($A$2:$A$29)/($A$2:$A$29=C2),COUNTIF($C$2:C2,C2)))
And drag down
If you're happy to add a few helper columns, this is a simple way to go:
The formula in column C creates a unique number by bringing together the eggs laid and the chicken number
=--(A2&"."&B2)
Column D is just your LARGE formula,
=LARGE($C$2:$C$4,B2)
Column E just gets the integer part of column D
=INT(D2)
And finally Column F gets the decimal part (chicken number) from column D
=--REPLACE(MOD(D2,1),1,2,"")

In Excel I have two columns that equal a third column but they don't equal each other. How do I get them to equal each other?

In Excel I have two columns that equal a third column. How do I get the first two to correspond to each other? Listed below is a small example. Sorry I didn't know to properly paste the Excel into this post. As you can see I have Columns A-E with the titles UPC, Barcode, RMSID, UPC and Barcode. Columns A and D are the same value of a UPC. Both B and C correspond to the UPC column or A and D. I want B and C to correspond to each other since they both share the value of A or D. So if C and D correspond to each other then B does also and I want this to show in Column E. How do I write this in Excel?
A B C D E
UPC Barcode RMSID UPC Barcode
834135001034 102432 883 892773000857 105422
892773000864 105423 884 818780010016 106487
892773000604 105421 888 892773000864 105423
892773000857 105422 900 892773000604 105421
818780010016 106487 910 834135001034 102432
ok, this looks like a straight forward Vlookup or index/ match. In E2 place the following formula:
=Vlookup(D2,$A$2:$C$6,2,0)
D2 is what you are looking up in the first column of A2:C6 where C6 is the bottom right corner of your data. the 2 tells the formula to return the value in the second column. the 0 or false tell the formula to find an exact match for what you are looking for.
you could also do this with an INDEX/MATCH combination. It tends to be preferred as vlookup only looks up information in the left most column and can only return information to the right. INDEX/MATCH does not have to line up vertically and the columns (or rows if you are doing horizontal lookups) can be in any order. I would use the following:
=INDEX($B$2:$B$6,Match(D2,$A$2:$A$6))
Match will tell you what postion from the top of the A2:A6 column the value in D2 was found. Index will then use that value to return the value in the same position from the top in column B2:B6.
When something is not found its going to spit out and error. You can deal with that error using the IFERROR function and either have it return some text to let you know, or return an empty cell with "". Here is one example:
`=IFERROR(VLOOKUP(D2,$A$2:$C$6,2,0),"Not Found")

Sum Multiple Columns when Not Equal to a Specific Value in EXCEL

I have 4 different IF(AND) statements in 4 different consecutive columns. I need to return the calculated values from each of these cells in a separate column.
Column J has the formula:
=IF(AND($D4
Column K has:
=IF(AND($D4>=$G4, $D4<=$H4),0.5*3.33,"-")
Column L has:
=IF(AND($D4>=$H4, $D4<=$I4),0.75*3.33,"-")
Column M has:
=IF(AND($D4>=$I4),3.33,"-")
My goal is to have the 5th Column (N) calculate the total of Columns J through M when they have a value and not a "-".
If I understand you correctly, I suspect that the following will achieve what you are trying to achieve:
=SUMIF(J1:M1,"<>-")
Essentially, this takes the range of the data you are looking at and adds it up where it is not equal to your marker of a non-value, "-".
Hope this helps.
Cheers!

Problems with implementing a two criteria vlookup substitute (sumproduct or index)

I have data on two tables, DATA and SpreadCodes. I need to write a formula that functions like a two-criteria vlookup. My tables look like this:
DATA table:
Col B ... Col I
01142 589
57834 007
Where Column S is where I'm trying to put the formula and where entries in Columns B & I are numbers stored as text.
SpreadCodes table:
Col A ... Col E ... Col G ... Col J
57834 007 15.50 15.50
45785 35893 10.00 10.00
Where entries in Columns A,E & G are numbers stored as text and where entries in Column J are stored as numbers.
I am trying to search the SpreadCodes table for the row where entries in DATA column B equal SpreadCodes Column A and where Data Column I equal SpreadCodes column E. Once a match is found, I need it to return the value in SpreadCodes column G OR Column J (They are the same, except G is stored as text, J is stored as number, so whichever makes this work).
I have tried several approaches to try to make this work. Nothing I tried below would return anything except an #NA value
I first tried creating a "helper" column where I concatenated the columns in both tables then just compared those values.
I then tried using two different index/match formulas (where one has concatenation included) :
=INDEX(SpreadCodes!G2:G202,MATCH(1,(SpreadCodes!A2:A202=B2)*(SpreadCodes!E2:E202=I2),0),7)
=INDEX(SpreadCodes!A1:K202,MATCH(Sheet2!B2&Sheet2!I2,SpreadCodes!A:A&SpreadCodes!E:E,0),7)
When that didn't work, I tried a sumproduct formula (being careful to specify SpreadCodes column J, since that one was a numerical value):
=SUMPRODUCT((SpreadCodes!A2:A202=Sheet2!C2)*(SpreadCodes!E2:E202=Sheet2!I2)*(SpreadCodes!J2:J202))
Since these codes often have leading zeros, I keep the columns in text so they don't get cut off, but even still, I'm not sure why these formulas aren't working. I've seen these work for other data. Any thoughts/ideas would be appreciated.
The sumproduct() works for me.
=SUMPRODUCT((SpreadCodes!A1:A100=Data!B1)*(SpreadCodes!E1:E100=Data!I1)*(SpreadCodes!J1:J100))
As per your data, This is how my data sheet looks like

Resources