Excel formula iferror,index, match

MarcoSpring

New Member
Joined
Mar 22, 2012
Messages
16
Hi All

Here is my question.

I have a table with Country codes (Column) and Expenses (Row) in Sheet 1
I have a similar table in Sheet 2,
However, the country and Expense codes are not in order and sequence.
In Sheet 2, (let say B2) what formula should I be using in order to copy the figures from Sheet 1.
(I only show few rows of expenses).

ABCDEFGHI
1GL CodesINDIAVIETSPOREHKINDOCHINAMSIA
2
501 - BANK CHARGES

<tbody>
</tbody><colgroup><col></colgroup>
50.00

<tbody>
</tbody><colgroup><col></colgroup>
100.00

<tbody>
</tbody><colgroup><col></colgroup>
150.00

<tbody>
</tbody><colgroup><col></colgroup>
250.00

<tbody>
</tbody><colgroup><col></colgroup>
400.00

<tbody>
</tbody><colgroup><col></colgroup>
200.00

<tbody>
</tbody><colgroup><col></colgroup>
20.00

<tbody>
</tbody><colgroup><col></colgroup>
3
502 - ADMIN CHARGES

<tbody>
</tbody><colgroup><col></colgroup>
10.00

<tbody>
</tbody><colgroup><col></colgroup>
20.00

<tbody>
</tbody><colgroup><col></colgroup>
40.00

<tbody>
</tbody><colgroup><col></colgroup>
40.00
50.00

<tbody>
</tbody><colgroup><col></colgroup>
50.0050.00
4
601 - LOCAL SALES

<tbody>
</tbody><colgroup><col></colgroup>
0.00

<tbody>
</tbody><colgroup><col></colgroup>
0.000.000.000.000.00
(3,500.00)

<tbody>
</tbody><colgroup><col></colgroup>
5
602 - OVERSEA SALES

<tbody>
</tbody><colgroup><col></colgroup>
(4,000.00)

<tbody>
</tbody><colgroup><col></colgroup>
(3,000.00)

<tbody>
</tbody><colgroup><col></colgroup>
(5,000.00)

<tbody>
</tbody><colgroup><col></colgroup>
(4,050.00)

<tbody>
</tbody><colgroup><col></colgroup>
(3,050.00)

<tbody>
</tbody><colgroup><col></colgroup>
(2,050.00)

<tbody>
</tbody><colgroup><col></colgroup>
0.00
6
701 - RENTALS

<tbody>
</tbody><colgroup><col></colgroup>
150.00

<tbody>
</tbody><colgroup><col></colgroup>
250.00

<tbody>
</tbody><colgroup><col></colgroup>
400.00
250.00

<tbody>
</tbody><colgroup><col></colgroup>
500.0050.00350.00
7
702 - UTILITIES

<tbody>
</tbody><colgroup><col></colgroup>
15.00

<tbody>
</tbody><colgroup><col></colgroup>
25.00

<tbody>
</tbody><colgroup><col></colgroup>
50.00
25.00

<tbody>
</tbody><colgroup><col></colgroup>
30.0050.0060.00
SHEET 1
ABCDEFGH
1GL CodesCHINAINDIAHKMSIASPOREVIETINDO
2601 - LOCAL SALESFormula?
3602 - OVERSEA SALES
4
5702 - UTILITIES
6701 - RENTALS
7
8501 - BANK CHARGES
9502 - ADMIN CHARGES
SHEET 2

<tbody>
</tbody>
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Use this in Sheet 2 B2 copied across and down:

=INDEX(Sheet1!$B$2:$H$7,MATCH($A2,Sheet1!$A$2:$A$7,0),MATCH(B$1,Sheet1!$B$1:$B$7,0))
 
Last edited:
Upvote 0
In B2 of Sheet2 enter, copy across, and down:

=INDEX(Sheet1!$B$2:$H$7,MATCH($A2,Sheet1!$A$2:$A$7,0),MATCH(B$1,Sheet1!$B$1:$H$1,0))

You can also invoke a VLOOKUP formula like this:

=VLOOKUP($A2,Sheet1!$A:$H,MATCH(B$1,INDEX(Sheet1!$A:$H,1,0),0),0)
 
Upvote 0
It depends on your version of Excel - which do you have?

=IFNA(INDEX(Sheet1!$B$2:$H$7,MATCH($A2,Sheet1!$A$2:$A$7,0),MATCH(B$1,Sheet1!$B$1:$B$7,0)),0)

=IF(ISNA(INDEX(Sheet1!$B$2:$H$7,MATCH($A2,Sheet1!$A$2:$A$7,0),MATCH(B$1,Sheet1!$B$1:$B$7,0)),0,INDEX(Sheet1!$B$2:$H$7,MATCH($A2,Sheet1!$A$2:$A$7,0),MATCH(B$1,Sheet1!$B$1:$B$7,0)))
 
Upvote 0

Forum statistics

Threads
1,213,567
Messages
6,114,342
Members
448,570
Latest member
rik81h

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