Iferror formula help

williams_ryan_1

New Member
Joined
Aug 15, 2016
Messages
9
Hello. I need help creating a formula to compare and look for items between sheet1 and sheet2 below. Sheet1 is a report I can run to see what lines currently exist in our system. Sheet2 is an example of what the monthly invoice looks like. I need to determine what the line numbers are (from Sheet1) for each line item on Sheet2. What formula can I use to compare the description, charge number and work location to populate the line # from sheet1 next to each line item on sheet2? Sheet2 is a pivot table if that makes a difference. If you could help that would be great!

SHEET1
Line # Description Charge number Funded Expended Remaining
1 WORKER 1 C12345 $126,426.45 $2,463.00 $123,963.45
2 WORKER 2 C23456 $4,783.52 $4,783.52 $-
3 WORKER 3 C34567 $921.96 $921.96 $-
4 WORKER 4 C45678 $866.40 $866.40 $-
5 WORKER 5 C56789 $35,208.40 $35,208.40 $-
160 WORKER 8 C78901 $1,397.60 $1,397.60 $-
8 WORKER 1 C89012 $5,915.91 $5,915.91 $-
9 WORKER 9 C90123 $980.10 $980.10 $-
162 WORKER 4 CA2345 $1,732.80 $1,732.80 $-
163 WORKER 8 CA2345 $7,056.72 $7,056.72 $-
164 WORKER 10 CA2345 $1,842.88 $1,842.88 $-

SHEET2 (Pivot Table)
ChargeNumber WorkLocation Description Code BillRate Hours Sum of Cost
C12345 On-Site WORKER 8 1000 $153.66 114 $17,517.24
C23456 Off Site WORKER 4 2000 $60.17 39 $2,346.63
C34567 On-Site WORKER 8 1000 $153.66 4 $614.64
C56789 On-Site WORKER 1 3000 $118.83 25 $2,970.75
C67890 On-Site WORKER 2 4000 $87.35 32.5 $2,838.88
C67890 On-Site WORKER 3 3000 $111.23 44 $4,894.12
C45678 On-Site WORKER 5 3000 $102.35 159.5 $16,324.83
C78901 On-Site WORKER 8 1000 $153.66 8 $1,229.28
C89012 Off Site WORKER 10 5000 $98.01 4 $392.04
C90123 Off Site WORKER 10 5000 $98.01 24 $2,352.24
C90123 On-Site WORKER 3 3000 $111.23 129 $14,348.67
C01234 On-Site WORKER 1 3000 $118.83 4 $475.32
CA2345 On-Site WORKER 2 4000 $87.35 23.5 $2,052.73
CA1234 On-Site WORKER 2 4000 $87.35 64 $5,590.40
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
I thought I had the columns formatted to see better than this but apparently the system removes the extra spaces I put in. Sorry for the jumbled mess.
 
Upvote 0
Maybe something like this:


Excel 2010
ABCDEF
1Line #DescriptionCharge numberFundedExpendedRemaining
21WORKER 1C12345$126,426.45$2,463.00$123,963.45
32WORKER 2C23456$4,783.52$4,783.52$0.00
43WORKER 3C34567$921.96$921.96$0.00
54WORKER 4C45678$866.40$866.40$0.00
65WORKER 5C56789$35,208.40$35,208.40$0.00
7160WORKER 8C78901$1,397.60$1,397.60$0.00
88WORKER 1C89012$5,915.91$5,915.91$0.00
99WORKER 9C90123$980.10$980.10$0.00
10162WORKER 4CA2345$1,732.80$1,732.80$0.00
11163WORKER 8CA2345$7,056.72$7,056.72$0.00
12164WORKER 10CA2345$1,842.88$1,842.88$0.00
Sheet1



Excel 2010
ABCDEFGH
1ChargeNumberWorkLocationDescriptionCodeBillRateHoursSum of CostLine #
2C12345On-SiteWORKER 81000$153.66114$17,517.24Not Found
3C23456Off SiteWORKER 42000$60.1739$2,346.63Not Found
4C34567On-SiteWORKER 81000$153.664$614.64Not Found
5C56789On-SiteWORKER 13000$118.8325$2,970.75Not Found
6C67890On-SiteWORKER 24000$87.3532.5$2,838.88Not Found
7C67890On-SiteWORKER 33000$111.2344$4,894.12Not Found
8C45678On-SiteWORKER 53000$102.35159.5$16,324.83Not Found
9C78901On-SiteWORKER 81000$153.668$1,229.28160
10C89012Off SiteWORKER 105000$98.014$392.04Not Found
11C90123Off SiteWORKER 105000$98.0124$2,352.24Not Found
12C90123On-SiteWORKER 33000$111.23129$14,348.67Not Found
13C01234On-SiteWORKER 13000$118.834$475.32Not Found
14CA2345On-SiteWORKER 24000$87.3523.5$2,052.73Not Found
15CA1234On-SiteWORKER 24000$87.3564$5,590.40Not Found
Sheet2
Cell Formulas
RangeFormula
H2{=IFERROR(INDEX(Sheet1!$A$2:$A$12,MATCH(Sheet2!C2&Sheet2!A2,Sheet1!$B$2:$B$12&Sheet1!$C$2:$C$12,0)),"Not Found")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
I did not include WorkLocation in the formula since you did not have it in your example in Sheet1.
 
Last edited:
Upvote 0
You brought up a good point. I'm not going to be able to match the WorkLocation since that doesn't pull up in my report. Ok what if we just matched last month's invoice with this months? So how would I match Sheet2 to another example of a Sheet2 (like the month prior)? All the same columns would exist if that makes sense. I have done this in the past with the below formula but it isn't working anymore for some reason? I am guessing they changed their formatting in excel? Or maybe the pivot tables have something to do with it?

=IFERROR(INDEX(Sheet1!$H$2:$H$1000,MATCH(1,(Sheet1!$A$2:$A$1000=$A2)*(Sheet1!$B$2:$B$1000=$B2)*(Sheet1!$D$2:$D$1000=$D2),0)),"")
 
Upvote 0
Sorry I should have been more specific. So what we would have is a Sheet1, which is the same format as my original Sheet2 example. The only difference is that there would be one more additional column (H) with the line numbers. So Sheet1 in this scenario would be the June invoice. Now I receive the July invoice which I would copy in as Sheet2. It is just like Sheet1 except that column H is empty. I need a formula for Sheet2 that pulls in the line numbers from Sheet1 column H. Does this make sense?
 
Upvote 0
Something like this?


Excel 2010
ABCDEFGH
1ChargeNumberWorkLocationDescriptionCodeBillRateHoursSum of CostLine #
2C12345On-SiteWORKER 81000$153.66114$17,517.24123
3C34567On-SiteWORKER 81000$153.664$614.64789
4C78901On-SiteWORKER 81000$153.668$1,229.28555
5C23456Off SiteWORKER 42000$60.1739$2,346.63456
6C56789On-SiteWORKER 13000$118.8325$2,970.75111
7C67890On-SiteWORKER 33000$111.2344$4,894.12333
8C45678On-SiteWORKER 53000$102.35159.5$16,324.83444
9C90123On-SiteWORKER 33000$111.23129$14,348.67888
10C01234On-SiteWORKER 13000$118.834$475.32999
11C67890On-SiteWORKER 24000$87.3532.5$2,838.88222
12CA2345On-SiteWORKER 24000$87.3523.5$2,052.73101
13CA1234On-SiteWORKER 24000$87.3564$5,590.40102
14C89012Off SiteWORKER 105000$98.014$392.04666
15C90123Off SiteWORKER 105000$98.0124$2,352.24777
Sheet1



Excel 2010
ABCDEFGH
1ChargeNumberWorkLocationDescriptionCodeBillRateHoursSum of CostLine #
2C12345On-SiteWORKER 81000$153.66114$17,517.24123
3C23456Off SiteWORKER 42000$60.1739$2,346.63456
4C34567On-SiteWORKER 81000$153.664$614.64789
5C56789On-SiteWORKER 13000$118.8325$2,970.75111
6C67890On-SiteWORKER 24000$87.3532.5$2,838.88222
7C67890On-SiteWORKER 33000$111.2344$4,894.12333
8C45678On-SiteWORKER 53000$102.35159.5$16,324.83444
9C78901On-SiteWORKER 81000$153.668$1,229.28555
10C89012Off SiteWORKER 105000$98.014$392.04666
11C90123Off SiteWORKER 105000$98.0124$2,352.24777
12C90123On-SiteWORKER 33000$111.23129$14,348.67888
13C01234On-SiteWORKER 13000$118.834$475.32999
14CA2345On-SiteWORKER 24000$87.3523.5$2,052.73101
15CA1234On-SiteWORKER 24000$87.3564$5,590.40102
Sheet2
Cell Formulas
RangeFormula
H2{=INDEX(Sheet1!$H$2:$H$15,MATCH(Sheet2!A2&Sheet2!C2,Sheet1!$A$2:$A$15&Sheet1!$C$2:$C$15,0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
For some reason I am getting the #N/A error in the cells after I paste the above formula and then press ctrl, shift, enter. I wish I could provide a screenshot but I'm not seeing where that is an option.
 
Upvote 0

Forum statistics

Threads
1,214,517
Messages
6,119,984
Members
448,935
Latest member
ijat

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top