This may be a weird request. I'm dealing about 100-250 rows for my case.
A simplified example screenshot:
I am using vlookup (column G & H) to assign the values based on Master sheet table.
But I was wondering if there is a way to include a formula for "checker" column to indicate if the values from vlookup are assigned correctly in G and H.
One way would be:
=IF(COUNTIFS($A$1:$A$5,E1,$B$1:$B$5,F1,$C$1:$C$5,G1)>0,"OK","Nope")
or without countifs:
=IF(SUMPRODUCT(($A$1:$A$5=E1)*($B$1:$B$5=F1)*($C$1:$C$5=G1))>0,"OK","Nope")
This doesn' check for duplicates in the first list. A simple countif could do that job
Related
So I have data like the following: link.
What I'm trying to find out is how many ids are running at the same time for type a and type b.
My current formula is
IF(c2=c3,IF(d2<>d3,IF(AND(A2>=a3,A2>=b3),"Not the Same","Same"),""),"")
This heavily relies on the sorting which I don't trust as there is most likely something the formula won't be able to account for such as 3 Ids coming up in the data.
I was trying to make a pivot to do the same thing but I was unable to get it to function how I needed it to.
Any ideas?
Here is a solution if helper columns are allowed. I've put in a helper column in column F
=IF(COUNTIFS(A$1:A1,"<="&E2,E$1:E1,">="&A2,C$1:C1,C2,D$1:D1,"<>"&D2)*(COUNTIFS(C$1:C1,C2,F$1:F1,">0")=0)>0,1,0)
Basically it checks if the dates overlap with any other row for the same ID but with a different type, and also checks that the match with a different type hasn't already been counted.
Also I've set all the blank dates to today() in column E with a simple formula
=IF(B2="",TODAY(),B2)
My formula works, but only if its in the same page, and along the same rows
Formula:
=(INDEX($C$1:$D$4,SMALL(IF($C$1:$C$4=$F$2,ROW($C$1:$C$4)),COLUMNS(D1:D4)),2))
Note: Column G has the formula, what it does it look for value in F2 (which is 1.2) within the columns of C & D, and extracts the respective data in column D. So in this case, it would extract the data in column G.
Question: Now what do I do if I want this to occur from different sheets, or even different workbooks? I need to do this exact same thing, extract the data that is in column c and d (which is on a different workbook) to my workbook.
Every time I try, I get a value error.
Bonus: I'm also trying to get the date that is closest to today's date, I have this formula here:
=IF(COUNT(G2:G5)>0,INDEX(G2:G5,MATCH(MIN(ABS(G2:G5-$D10)),ABS(G2:G5-$D10),0)),"")
Where D10 is just equal to =TODAY() and this entire formula works by pressing ctrl+shift+enter
If you can also include this into the formula so that it just spits out the closest date in G2 rather than spit out all the dates. But it is not necessary, just helps a lot.
For your "Closest to today problem", I was trying to spread the difference of the date or a comparison of the date just like in your example. This is just not working out. I solved the problem by adding another column. I do not know if this is a valid option for you or not, but here is what I have. Assuming H is available or you can insert a new column H. use this dragged down for each row - in your exampl 2 thorugh 5.
=ABS(D$10-G2)
Then add this in H10 or wherever you see fit
=D10-(MIN(H2:H5))
Here is an excel-ish example
5/12/2014 =ABS(D$10-G2)
5/13/2015 =ABS(D$10-G3)
5/14/2014 =ABS(D$10-G4)
5/15/2014 =ABS(D$10-G5)
6/6/2016 =D10-(MIN(H2:H5))
I'm trying to use Excel to extract figures based on multiple criteria and their location within columns.
So for example. If I wanted to do a SUMIF to receive the figures associated with the First class. The formula would retrieve the figure in a specified row,
But If I wanted to retrieve the figure associated with England. The formula would contain multiple criteria to look for the First class then look for the country England and retrieve the figure on its row in a specified column.
These columns will grow and shrink each month. Meaning I need it to be somewhat dynamic.
I've tried to do this using SUMIF and SUMIFS with no luck.
=SUMIFS(D2:D10,A2:A10,"First",B2:B10,"England")
The challenge you have is that in columns A, B and C, the values are not repeated downwards into the now blank cells. So values do not appear next to each other in the same row.
Assuming that the example you gave is quite simple, and you could also have multiple International Products for a given Class and Country, I would go for the following solution:
Reserve two columns (E and F) for intermediate calculations. If they are currently used, move those used columns to the right, making room for an empty E and F column. You could of course also choose two other columns for this purpose. But I will assume they are E and F.
Then in E2 put this formula and copy it further down the E column as far as needed.
=IF(A2<>"", A2, OFFSET(E2,-1,0))
In F2 put this formula and copy it down as well:
=IF(B2<>"", B2, IF(A2<>"", "", OFFSET(F2,-1,0)))
This should give the following display (the header titles in E1 and F1 are cosmetic only):
Now you can do formulas on those columns in combination with the C column. For instance:
=SUMIFS(D2:D10, E2:E10,"First", F2:F10,"England", C2:C10,"")
And this would output 2. Note that if you really only want to match one row, you should specify a condition for each column (E, F and C).
The intermediate formulas in the E and F columns are quite resistant to deletion of rows, due to the use of OFFSET. If you insert rows, you should of course make sure the formulas in E and F are copied into it.
If you will ever use more than 3 columns for the source data, you'll need to also add more intermediate columns with similar formulas. Also your SUMIFS would need extra conditions then.
You could use the following SUMPRODUCT() For Class and Country:
=SUMPRODUCT(($A$2:$A$10=$F$1)*($B$3:$B$11=$G$1)*($D$3:$D$11))
Then for all three:
=SUMPRODUCT(($A$2:$A$10=$F$1)*($B$3:$B$11=$G$1)*($C$4:$C$12=H1)*($D$4:$D$12))
A picture for references.
The idea is that each column must move down one row in its reference. And the Sum column must start on the same row as the last column being referenced.
Following data structure:
ID CRIT1 CRIT2
1 L M
2 H M
3 H H
I would like to get the IDs with Crit1= H and Crit2=H.
In a second sheet I want to build a table with the IDs which satisfy my criteria. So in this case only 3.
I tried with INDEX/MATCH and COUNTIF.
However, so far no useful solution based on strings and ranges.
I suggest a PivotTable without Totals or Subtotals, in Tabular Form, all three columns as ROWS and filtered to select H for each of CRIT1 and CRIT2:
Here is a formula solution That will create your table without any blanks.
This assumes your source data are in Sheet1. Edit as necessary.
=IFERROR(INDEX(Sheet1!A$2:A$9999,SMALL(IF((Sheet1!B$2:B$9999="H")*(Sheet1!C$2:C$9999="H"),ROW(Sheet1!A$2:A$9999),9E+99),ROW(1:1))-1),"")
This is an array formula and must be confirmed with Ctrl+Shift+Enter.
Now copy downard as far as needed.
Note: adjust the 9999s to a row number suitable to your situation.
Without macros you can only copy the single cells if the criteria are satisfied, and don't copy them if not. Paste this formula in A2, then copy it to right (other columns), and to bottom (other rows):
=IF(AND(Sheet1!$B2="H";Sheet1!$C2="H");Sheet1!A2;"")
Ok so the pivot table does work yes, however I want to plot a graph which seems to be impossible with pivot data model
Regarding the formula solution I don't think it works.
It will give me all IDs with either crit1=h or crit2=h
Hello,
Please forgive me if I didn't word my question very well. However, I have an excel spreadsheet that I must complete and submit to our headquarters on a monthly basis. I've been manually editing most of the fields but I think there's a way to automate some of the values. Unfortunately, I haven't figured it out yet so I thought I'd seek help here.
So I have two tables (Table1 and Table2) - images below. What I need is a way to automatically populate the RATE FACTOR (Column D) if the WEIGHT (Column C) falls within a certain range (defined in table2).
I was reading on here about using VLOOKUP, but couldn't get it to work. Any assistance would be appreciated, thanks.
IMAGES BELOW (had trouble attaching images to question).
Table 1: https://dl.dropbox.com/u/55292384/table1.jpg
Table 2: https://dl.dropbox.com/u/55292384/table2.jpg
//Kismet
Assuming that your example has the titles in row 1, in cell D2 enter =VLOOKUP(C2,$G$2:$H$17,2)
You can copy this formula to the other cells in column D.
VLOOKUP demands that the table of values is sorted in ascending order by the first column. The lookup value (here C2) is found in the first column and the 2 says to return the corresponding value in the second column. By default if the lookup value is not found, VLOOKUP returns the result corresponding to the nearest value less than the lookup value. This may or may not suit your rate factor calculation (if not, I can make an additional suggestion).