Am a little new to excel and puzzled as to how to solve this problem. I have two excel sheets.
Sheet 1 looks like (large data set):
HIC GSN ND11
H1C 00214 0212107
C4I 07287 0214380
L1A 07731 0214501
Sheet 2 looks like:
Condition HIC1 HIC1 HIC1 GSN GSN GSN
AMA B60 B61 B62 02934 02935
ALD H1A H1C 04821 03473
HEC W0A W0B
For example, in Table 1, if the HIC or GSN on row 1 (H1C or 00214) is present anywhere in table 2, it fetches the ND11 number from table 1 corresponding to the match. I tried using a VLOOKUP, but am failing at how to go about approaching the problem.
The VLOOKUP I tried was,
=VLOOKUP(OR(Table1'H1C', Table1'00214),Table2A2:G2,Table1'ND11',0)
Any help would be great.
UPDATE:
OK, I re-read the question and I think I misunderstood; you want to match HIC or GSN. In that case, I had to use some helper columns because I don't know of an way to arithmetically OR arrays. So, I came up with this ...
... where I7, J7, and K7 formulas are (respectively):
=IFERROR(MATCH(B7,$A$2:$A$4,0),IFERROR(MATCH(C7,$A$2:$A$4,0),IFERROR(MATCH(D7,$A$2:$A$4,0),NA())))
=IFERROR(MATCH(E7,$B$2:$B$4,0),IFERROR(MATCH(F7,$B$2:$B$4,0),IFERROR(MATCH(G7,$B$2:$B$4,0),NA())))
=INDEX($C$2:$C$4,IFERROR(I7,IFERROR(J7,NA())))
You could replace the last IFERROR(J7,NA()) with just J7, but the Excel error handling will whine.
ORIGINAL:
If I understood your problem correctly (which I doubt), you want to get the ND11 value from Sheet1 for the matching HIC and GSN values. For single matching, the INDEX/MATCH combo works well. However, for multiple criteria, the SUMPRODUCT works better. In the following screenshot ...
... I used the following formula to get the value of ND11 in the first table only where the value from column C matches the HIC and column F matches the GSN ...
=SUMPRODUCT((--($A$2:$A$4=C10)*--($B$2:$B$4=F10))*$C$2:$C$4)
Now, I'm not sure why you have three HIC's and three GSN's, so you'll have to elaborate on your question if this isn't the expected result.
Related
I have 3 columns of data per date (Vector, X:1, Y:1). I have 2 sheets; sheet 1 with the source data and sheet 2 where I need the data.
What I need to do: I need the X-values (X:1) (I'll worry about Y-values later) from Sheet 1 (first image) to be copied over to Sheet 2 (second image) through a dynamic selection (a drop down list based on a date (which I have)). However, the X-Values have to copied in a specific order, each 'set' of data is based off of a ring, that ring is then split into 8 locations (image 3). (I hope that made sense)
I've tried using =index and vlookup and xlookup (see comments) but they don't quite work, ending up with #REF! and #VALUE! errors.
I've uploaded the current file I'm using to google drive, if it helps please use that. Sheet 1 is sheet 1 and Sheet 2 is X+Y (Comparison (Day Selection).
Thanks
Example of How to Use XLOOKUP Across Multiple Sheets:
=XLOOKUP(A1,Sheet2!$A$1:$A$150,Sheet2!$B$1:$B$150)
Explanation:
A1 is the search key, that is, the value that you are using for your search.
Sheet2!$A$1:$A$150 is where you expect the value of A1 to be found.
Sheet2!$B$1:$B$150 is the final output as a result of the search.
If, for example, the value in A1 is equal to the value in Sheet2 A4, the final output will be the value in Sheet2 B4.
Use relative and absolute references as necessary when copying the formula to other cells.
I've made an Excel sheet to ease some calculations, but I'm stuck to the point explained in the title. The data is a list of rows containing a date, two names, and two numbers, like the following one:
and so on.
I do need a formulae capable to count all the rows containing for example "Jane" where amount1+amount2 > 4.
So far I've made some test with COUNTIFS(...): this is a working example of a formula which counts all the rows containing the word "Jane" in both NameA and NameB fields where amount1 > 0 and amount2 > 0:
=SUM(COUNTIFS(A1:A100,"Jane",D2:D100,&">0",E2:E100,&">0"),COUNTIFS(B1:B100,"Jane",D2:D100,&">0",E2:E100,&">0"))
Same approach doesn't seem to work trying to search for the sum of the two amount fields, as follows:
=SUM(COUNTIFS(A1:A100,"Jane",D2:D100,"+"&E2:E100"&>4"),COUNTIFS(B1:B100,"Jane",D2:D100,"+"&E2:E100"&>4"))
COUNTIFS does not work with addition like that. One will need to switch to SUMPRODUCT:
=SUMPRODUCT(((A1:A100="Jane")+(B1:B100="Jane")>0)*(D2:D100+E2:E100>4))
I would like to lookup a value in another excel file that will have multiple results as rows. For example If the specific value is found in the column A of that row I want to add the number in column c to a total and then output that.
Book 1 VLookup from this sheet :
Book 2 Vlookup destination:
Desired Result:
I would normally add what I have tried, but im completely stumped, the only real formula ive tried is a standard VLookup. The Watered down question is "Need to know: how many sales per unique sku?"
As #BigBen suggested in the comment, use =SUMIF() formula.
in a pseudocode: =SUMIF(range_to_check, product_name, sales_amount_range)
So with the following data:
The formula in E1 which you can drag to other cells in the column would look like:
=SUMIF(A1:A6, D1, B1:B6)
I have two sheets with last names and addresses in Columns A-F. I've tried using multiple formulas to compare the data, but the closest I've gotten is one row will show 'TRUE' while all other rows show '#VALUE'. Also, I've tried using different row numbers; if I use A1 to A69 it will work when comparing only Column A, but if I use A70 or greater then I get the '#VALUE'. Can anyone please help?
I've used the following, and have tried variations of them:
=COUNTIF(Proper2!A:F,A8828:F8828)=6
=COUNTIF(Proper2!A:A,A8828)=1
=AND(EXACT(A2:A69,A16))
=AND(Proper2!A2:A69,A16))
=IF(ISNA(VLOOKUP(A2,Sheet2!A1:A10,1,0)),"no","yes")
I would like to have a column that showed either 'True/False' or 'Yes/No' for instance; Row18 A:E which matches Row3 G:K.
The simplest thing I could think of is,
1) Concatenate all columns for each row and store in some column (far away say AM,AN So that it doesnt disturb). Do this for both the tables, for all rows
=CONCATENATE(A2,B2,C2,D2,E2)
=CONCATENATE(G2,H2,I2,J2,K2)
2) Now compare AM and AN using countif and if. This will tell you if there is a match or not
=IF(COUNTIF($AN$2:$AN$7,AM2)>0, "Match", "No Match")
I have a spreadsheet that looks like this:
The data is in the coloured section, to the right of that is a table that shows the average of the result column when the data under ABC, XYZ, or GGG is inbetween the Max and Min Value.
This was done with this formula: =AVERAGEIFS($D$4:$D$27,A$4:A$27,"<"&$F5,A$4:A$27,">"&$G5)
What I want to do is have that formula reference the heading and then lookup the appropriate column in the data table to apply the averageif criteria to.
The formula I have now works fine but as I add more columns and the data table that may be out of order it would be much better if I was able to incorporate a lookup or match into the averageifs formula.
The following non-volatile function will do it:
=SUMPRODUCT(($A$1:$C$1=H$1)*($A$2:$C$21>=$G2)*($A$2:$C$21<=$F2)*($A$2:$C$21))/SUMPRODUCT(($A$1:$C$1=H$1)*($A$2:$C$21>=$G2)*($A$2:$C$21<=$F2))
EDIT
To get the average of the results column when the other column is within the constraints. Change the fourth Criterion in the first SUMPRODUCT():
=SUMPRODUCT(($A$1:$C$1=H$1)*($A$2:$C$21>=$G2)*($A$2:$C$21<=$F2)*($D$2:$D$21))/SUMPRODUCT(($A$1:$C$1=H$1)*($A$2:$C$21>=$G2)*($A$2:$C$21<=$F2))
EDIT2
Another option that is both non volatile and non array:
=AVERAGEIFS(D:D,INDEX(A:C,0,MATCH(H$1,1:1,0)),">=" & G4,INDEX(A:C,0,MATCH(H$1,1:1,0)),"<=" &F4)
if you are doing it over a small number of calcs then the Offset function will work for you replace your reference to your current A column with
OFFSET($A$4,0,MATCH(h$2,$a$2:$d$2,0))-1,24,1)
The offset is broken down in to $A$4 being your reference point.
The 0 being how many rows to move from the reference point to start
The MATCH(h$2,$a$2:$d$2,0))-1 being how many columns to move from the reference point
The 24 is the number of rows to return
The 1 is how many columns to return
The match formula looks for the value in H2 in your header road in A2:D2 for an exact match and returns the number for the spot the item was found. We subtract 1 from this result as we only want to move one less spot than where the item was found. So it if was found in the 1st spot we dont want to move over any columns so we need to make the value 0.
You end formula would look something like:
=AVERAGEIFS($D$4:$D$27,OFFSET($A$4,0,MATCH(h$2,$a$2:$d$2,0))-1,24,1),"<"&$F5,OFFSET($A$4,0,MATCH(h$2,$a$2:$d$2,0))-1,24,1),">"&$G5)