formula require...

VBABEGINER

Well-known Member
Joined
Jun 15, 2011
Messages
1,284
Office Version
  1. 365
Platform
  1. Windows
hi all,

I need formula, where lookup values are in two different columns, and with combination of these 2 values I want to find an answer....

[TABLE="width: 453"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[TD]Column E[/TD]
[/TR]
[TR]
[TD]E[/TD]
[TD]L[/TD]
[TD]p[/TD]
[TD]q[/TD]
[TD]r[/TD]
[/TR]
[TR]
[TD]30[/TD]
[TD]L1[/TD]
[TD]10[/TD]
[TD]40[/TD]
[TD]60[/TD]
[/TR]
[TR]
[TD]31[/TD]
[TD]L2[/TD]
[TD]20[/TD]
[TD]50[/TD]
[TD]70[/TD]
[/TR]
[TR]
[TD]31[/TD]
[TD]L1[/TD]
[TD]30[/TD]
[TD]60[/TD]
[TD]80[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Value to find[/TD]
[TD][/TD]
[TD]Answer Require..[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]31[/TD]
[TD]L1[/TD]
[TD="align: right"]80[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

I use this formula, but these is something wrong..
=VLOOKUP(AND(A4,B4),A2:E4,3,FALSE)
 
The part in red makes this an array formula. In order for excel to know that it is an array formula and calculated it correctly you need to use CSE to enter the formula.
Code:
=INDEX(E2:E4,MATCH(A7&B7,[COLOR=#ff0000]A2:A4&B2:B4[/COLOR],0))

https://support.office.com/en-us/ar...formulas-7d94a64e-3ff3-4686-9372-ecfd5caa57c7

Some formulas do not need CSE because the argument can handle array operations
The Array_1, Array_2... argument in sumproduct
Code:
=SUMPRODUCT([COLOR=#ff0000]array1[/COLOR], [COLOR=#ff0000][array2][/COLOR], [COLOR=#ff0000][array3][/COLOR], ...)

The Lookup_vector argument in the LOOKUP and the result_Vector argument in the LOOKUP
Code:
=LOOKUP(lookup_value, [COLOR=#ff0000] lookup_vector[/COLOR],  [COLOR=#ff0000][result_vector][/COLOR])

The array argument in index
Code:
=INDEX([COLOR=#ff0000]array[/COLOR], row_num, [column_num])

The array argument in aggregate for function 14 to 19
Code:
=AGGREGATE(function_num, options, [COLOR=#ff0000]array[/COLOR], [k])

some arguments can never be arrays. This is also true of the __s versions like sumifs, countifs, averageifs
Code:
=VLOOKUP([COLOR=#ff0000]Lookup_Value,T[/COLOR]able_array, Col_index_num,[rage_lookup])
=HLOOKUP([COLOR=#ff0000]Lookup_value[/COLOR], Table_array,Row_index_number,[range_lookup])
=SUMIF([COLOR=#FF0000]range[/COLOR],criteria,[COLOR=#FF0000][sum_range][/COLOR])
 =COUNTIF([COLOR=#FF0000]range[/COLOR],criteria)
 =AVERAGEIF([COLOR=#FF0000]range[/COLOR],criteria,[COLOR=#FF0000][average_range][/COLOR])
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,224,827
Messages
6,181,200
Members
453,022
Latest member
RobertV1609

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