Send data (Job #) in one column to another spreadsheet, if another column contains data - excel

Here is a sample of the data I'm using. The letters are the estimated time in each area of the workshop (i.e. A. is clean up, B. is welding etc.):
J/C # A. B. C. D. E. F. G. H. TOTAL
97647 45 45 90 30 120 330
97651 15 30 45
97626
99999 60 120 75 360 615
11111 90 30 15 15 150
12345 10 20 30 40 50 60 70 80 360
On another sheet I need a column of all the Job Card numbers (J/C #) for each workshop area. I would like these automatically to appear when the budgeted time is put into this first sheet.
For example the Welding Sheet will have the following J/C #.
97647
99999
12345
I have been trying INDEX and MATCH and LOOKUP and VLOOKUP functions, but haven't yet found a solution.
Is this possible?

I have a solution that works -- hopefully I can explain it clearly.
Let's say your table is on "Sheet1". Create new sheets, one for each workshop (so, I have a "Sheet1", "A","B","C",...,"H").
In your "A" sheet, put this formula in A1:
=IFERROR(INDEX(Sheet1!$A$2:$A$10000,SMALL(IF(Sheet1!B$2:B$10000<>"",ROW(Sheet1!A$2:A$10000)-ROW(Sheet1!A$2)+1),ROWS(Sheet1!A$2:A2))),"") Enter with CTRL+SHIFT+ENTER and drag down.
This will create a population of those Job #s that have some value under the "A." column in "Sheet1".
To use this formula for your "B." column, put this formula in sheet "B", cell A1:
=IFERROR(INDEX(Sheet1!$A$2:$A$10000,SMALL(IF(Sheet1!C$2:C$10000<>"",ROW(Sheet1!A$2:A$10000)-ROW(Sheet1!A$2)+1),ROWS(Sheet1!A$2:A2))),"")
Notice the only change is in the "SMALL(IF(Sheet1!C$2:C$10000<>..." That's because since you want to return any job numbers for your "B." column, which is in Column C of Sheet1. ...so for your "C." Sheet, in A1, put the above formula but using column D for the "Small(If(Sheet1!C$2:C$10000" part.
Does this make sense?
The only thing is that you'll need to tweak depending on your sheet names (since I don't know what C,D,E, etc. actually refer to).

Related

Sum the values of a cell in Excel or change to a different expression of that value in another cell

I have a cell of a worksheet with a value of
1h 25m
entered with the cell (got it from a Jira import). I am trying to figure out how to populate another cell on the same row with a purely numerical version of this cell value, i.e.
85
This is so that I can run SUMIF statements to get the total amounts of minutes for a given person, on a given day.
As in the provided image, I want the sum total amount of Log Work (Column C) for Matthew R. on the 17th of October.
Here, we're creating two helper columns. You could combine everything, but thought this may be easier to illustrate.
Value
hours
minutes
sum
5m
0
5
5
1h 35m
1
35
95
3h
3
0
180
4h 55m
4
55
295
12h
12
0
720
Column A (Value) is your original value.
Column B (hours) is the following formula, which finds the letter "h" and returns everything to the left of it. If H is not found then return a 0.
=IFERROR(LEFT(A2,FIND("h",A2)-1),0)
Column C (minutes) is the following formula, which returns everything to the right of "h" and then removes "m" and trims it. But if "m" is not found then return a 0.
=IF(ISNUMBER(SEARCH("m",A2)),TRIM(SUBSTITUTE(IFERROR(RIGHT(A2,LEN(A2)-FIND("h",A2)),A2),"m","")),0)
Lastly, column D simply calculates total minutes as:
=(B2*60)+C2
You can probably shorten column C's formula, but this at least provides you an interim solution.

Make formula for list of row names independent from entire column and first row

I have the following Excel spreadsheet:
A B C D E F G H
1 Q1 Q2 Q3 Q4 Search criteria: 60 Asset 2
2 Asset 1 15 85 90 70 Asset 3
3 Asset 2 40 80 45 60 Asset 3
4 Asset 3 30 60 55 60 Asset 5
5 Asset 4 12 72 25 15
6 Asset 5 60 48 27 98
7
In Cells A1:E6 I have different assets with their performance from quarter Q1-Q4.
In Column H I list all assets that match the search criteria in Cell G1.
In this case the search criteria is 60 which can be found in the Cells A1:E6 for the Assets 2, 3 and 5.
For creating the list I use the formula from here:
=INDEX(A:A,SMALL(IF($B$2:$E$6=$G$1,ROW($B$2:$E$6)),ROW(1:1)))
All this works fine so far.
Now when I move the Cells A1:E6 in the sheet for example to D9:H14 the array formula keeps only working if it still refers to A:A and ROW(1:1) which might be a problem if the user decides to delete ROW(1:1). Therefore, I tried to modify the formula to:
=INDEX($D$9:$D$14,SMALL(IF($E$10:$H$14=$J$10,ROW($E$10:$H$14)),ROW($D$9:$H$9)))
However, with this modification I get #NUM! error.
Do you have any idea if it is possible to make the array formula independent from A:A and ROW(1:1) so it refers only to the Cells A1:E6 and automatically moves when the those cells are moved?
If you use excel 2013 or later then you can use following formula.
=IFERROR(INDEX($D$10:$D$14,AGGREGATE(15,6,ROW($1:$5)/($E$10:$H$14=$J$10),ROW(1:1))),"")
You can limit A:A to A1:A6 so that it would adjust as necessary when you move it. Your formula should thus be now
=INDEX(A1:A6,SMALL(IF($B$2:$E$6=$G$1,ROW($B$2:$E$6)),ROW(1:1)))
As for ROW(1:1), your top formula should always be ROW(1:1) and when you drag it down, then next formula should have ROW(2:2). When you move your top formula somewhere else and the ROW(1:1) changes to something like ROW(9:9) or anything, change it to ROW(1:1).
Please note that 'moving' your formula is different from 'dragging it down'.
EDIT:
So after you moved your data set, the top formula should now be:
=INDEX($D$9:$D$14,SMALL(IF($E$10:$H$14=$J$10,ROW($E$10:$H$14)),ROW(1:1)))
This is assuming that cell G1 (criteria) is also moved to J10.

Excel splitting one row into separate rows of a fixed number of colums

Here is a sample of the data I have in one row in an excel file. I would like to split it into multiple rows after every seven columns
15-Feb 20 783 175 105 $180 $973 15-Mar 31 900 58 145 $106 $140
to
15-Feb 20 783 175 105 $180 $973
15-Mar 31 900 58 145 $106 $140
You can use this formula:
=INDEX($1:$1,INT(COLUMN()+(ROWS(A$5:A5)-1)*7))
drag/copy this formula across till row 7 and down as required.
Issue with this formula is it will return 0 if cell is blank.
So alternatively, you can check for cell blank condition and write formula as:
=IF(ISBLANK(INDEX($1:$1,INT(COLUMN()+(ROWS(A$5:A5)-1)*7))),"",INDEX($1:$1,INT(COLUMN()+(ROWS(A$5:A5)-1)*7)))
If you have a well defined and deterministic way to split the two halves (for instance, columns "A" to "D" is the first half, while columns "E" to "H" is the second), you can enter a formula in a different sheet like (this is pseudo-code; you will need to verify the syntax):
Cell "A1" of the new sheet: ='Other_Sheet'!A(round(row()/2)+1)
Cell "A2" of the new sheet: ='Other_Sheet'!E(round(row()/2)+1)
The indirect reference is made such that it will go to the next row in the source sheet every two rows in the new sheet.

Excel 2013: How to sum values of a given range by omitting values given in a different range

I have a WorkSheet with ProfitCenter, Cities and Amounts (called Data).
Then I have a second worksheet (same workbook) with exceptions of cities (named Exceptions)
Now I would like so sum all Profitcenter amounts in a range on Data-Worksheet except those where there cities are in a range of the exceptions-worksheet, but just for a specified report.
E.g.:
Data-Sheet:
A B C
ProfitCenter | City | Amount
111 NY 1000
111 Paris 2000
222 Paris 3000
333 Rom 500
111 London 600
111 Helsinki 8000
Exception-Sheet
A B
City | Reportname
Paris A
Paris B
London A
To demonstrate a bit better what I want to do, here is the formula that doesn't work:
=sumproduct((Data!c:c)*(Data!A:A = "111")*(Data!B:B <> Exception!A:A)*(Exception!Reportname = "A"))
The Problem is, I have no fix cell value to use for comparison but two different ranges
Is there anybody who can help me solving that Problem?
The simplest approach here seems best for your purposes. This will be by adding in a helper column in your Data sheet, which will define each cell's acceptability for summation.
In your Data sheet, on column D, add this formula (starting D2 and copied down), which does the following things: (1) Counts the number of times that the city in cell B2 on the Data sheet appears on the exception list, (2) excluding items where the Report name does NOT equal "A" [you will likely want some method of formulizing which report you care about, but I left it hardcoded for now], and (3) Checks to see whether the amount of matches on the exception list is equal to 0.
=COUNTIFS('Exceptions Sheet'!A:A,B2,'Exceptions Sheet'!B:B,"<>A")=0
Then simply have E1 sum the results, as follows:
=SUMIFS(C:C,D:D,TRUE)

Issues with VLOOKUP in Excel

I have a tax table in one sheet that has a list of tax values. For example:
Sheet1: Tax Tables
A B C
1 Min Max Taxed
-------------------
2 50 100 10
3 100 200 20
4 200 300 30
In another sheet I have a gross income value of say 120 in cell A1. What I want to do is have a vlookup (I'm assuming that's what I should use) that checks cell A1 to see if it's between the Min and Max and then outputs the taxed amount in B1.
Sheet2: Income
A B
1 Gross FedTax
-----------
2 120 Value from Column C goes here
I already have the sheet in Tax Tables set up with named spaces A:C=Min and B:C=Max
I tried doing this:
=AND(VLOOKUP(<A1,Min,3,False),VLOOKUP(>A1,Max,2,FALSE))
But not even close...
I just want to check column A in the first sheet to see if it's less than the the value in the second sheet, and check column B in the first sheet against the value in the second for if its more, then put the value in column C in the first sheet into the cell next to the value in the second sheet.
To use a VLOOKUP, put your maximums and minimums in the same column.
Then use the TRUE argument, which means it looks for the next value that matches. Assuming the value you're looking up in D2, you'd put a formula like this in E2:
=VLOOKUP(D2,$A$2:$B$5,2,TRUE)
First of all it is unclear what you would apply when the amount is exactly 50/100/200/300/... So i decided to include the lower limit in the interval and exclude the upper limit.
For this problem I would use a sumifs like this (you have to decide on which side to put the equal sign:
=SUMIFS(Sheet1!C:C;Sheet1!A:A;"<="&A1;Sheet1!B:B;">"&A1)
This would only take those elements in column C that have a value in column A smaller than or equal to 120 and a value in column B greater than 120

Resources