SOLVED

Select Percentage from a table based on 2 criteria in another table

%3CLINGO-SUB%20id%3D%22lingo-sub-2694035%22%20slang%3D%22en-US%22%3ESelect%20Percentage%20from%20a%20table%20based%20on%202%20criteria%20in%20another%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2694035%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20working%20with%20Office%20Online%20(365)%20and%20trying%20to%20select%20the%20percentage%20from%20a%20table%20based%20on%20the%20total%20miles%20and%20total%20money%20earned%20from%20another%20table.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Percentage%20matrix.png%22%20style%3D%22width%3A%20505px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F306368iBA335A451DD5454B%2Fimage-dimensions%2F505x141%3Fv%3Dv2%22%20width%3D%22505%22%20height%3D%22141%22%20role%3D%22button%22%20title%3D%22Percentage%20matrix.png%22%20alt%3D%22Percentage%20matrix.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E*%20miles%20are%20in%20column%20B%2C%20money%20is%20listed%20in%20row%202%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Miles%20and%20Money.png%22%20style%3D%22width%3A%20392px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F306370i9155946A18B42C78%2Fimage-dimensions%2F392x106%3Fv%3Dv2%22%20width%3D%22392%22%20height%3D%22106%22%20role%3D%22button%22%20title%3D%22Miles%20and%20Money.png%22%20alt%3D%22Miles%20and%20Money.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E*%20Total%20Miles%20are%20in%20column%20E%20and%20driver%20names%20start%20on%20row%2020.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20found%20a%20site%20that%20helped%20me%20construct%20this%20formula%3A%3C%2FP%3E%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3DINDEX(C6%3AH12%2CMATCH(E20%2CB6%3AB12%2C1)%2CMATCH(F20%2CC4%3AH4%2C1))%3C%2FP%3E%3CP%3EUnfortunately%2C%20the%20only%20results%20returned%20are%20%23N%2FA.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20have%20I%20missed%20in%20creating%20my%20formula%3F%26nbsp%3B%20Is%20there%20a%20better%20way%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2694035%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%20for%20web%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2694090%22%20slang%3D%22en-US%22%3ERe%3A%20Select%20Percentage%20from%20a%20table%20based%20on%202%20criteria%20in%20another%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2694090%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1119667%22%20target%3D%22_blank%22%3E%40DarrMik%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EChange%20the%20values%20in%20the%20MILES%20column%20to%3C%2FP%3E%0A%3CP%3E0%3C%2FP%3E%0A%3CP%3E1201%3C%2FP%3E%0A%3CP%3E1751%3C%2FP%3E%0A%3CP%3E2151%3C%2FP%3E%0A%3CP%3E2551%3C%2FP%3E%0A%3CP%3E2951%3C%2FP%3E%0A%3CP%3E3251%3C%2FP%3E%0A%3CP%3EChange%20the%20values%20in%20the%20money%20row%20to%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E0%26nbsp%3B%26nbsp%3B%205001%26nbsp%3B%26nbsp%3B%206001%26nbsp%3B%26nbsp%3B%207001%26nbsp%3B%26nbsp%3B%208501%26nbsp%3B%26nbsp%3B%209501%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EUse%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DINDEX(%24C%246%3A%24H%2412%2CMATCH(E20%2C%24B%246%3A%24B%2412)%2CMATCH(F20%2C%24C%244%3A%24H%244))%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EP.S.%20you%20mention%20%22money%20is%20listed%20in%20row%202%22%20but%20your%20formula%20uses%20C4%3AH4.%20One%20of%20those%20is%20incorrect.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2694628%22%20slang%3D%22en-US%22%3ERe%3A%20Select%20Percentage%20from%20a%20table%20based%20on%202%20criteria%20in%20another%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2694628%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1119667%22%20target%3D%22_blank%22%3E%40DarrMik%3C%2FA%3E%26nbsp%3BSince%20you%20mention%20to%20be%20working%20in%20the%20online%20version%20for%20Excel%2C%20you%20can%20use%20XMATCH%20and%20some%20dynamic%20array%20functionality.%20Created%20a%20mockup%20of%20your%20schedule%20to%20demonstrate%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENote%20that%20I%20used%20named%20ranges%20(created%20in%20the%20desktop%20version)%20to%20keep%20the%20formulae%20easier%20to%20read.%20Although%20you%20can't%20create%20new%20or%20change%20existing%20named%20ranges%20in%20the%20online%20version%2C%20you%20can%20work%20with%20them%20in%20Excel%20for%20the%20Web.%20Replace%20these%20named%20ranges%20by%20absolute%20cell%20references%20(e.g.%20%22grid%22%20would%20become%20%24C%244%3A%24H%2410%20in%20the%20attached%20example)%20if%20you%20do%20not%20have%20access%20to%20Excel%20for%20the%20desktop%20to%20change%20them.%20Also%20used%20some%20custom%20formatting%20for%20the%20row%20and%20column%20headers.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2700047%22%20slang%3D%22en-US%22%3ERe%3A%20Select%20Percentage%20from%20a%20table%20based%20on%202%20criteria%20in%20another%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2700047%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20mock%20up%20was%20very%20helpful%20in%20testing%20my%20actual%20values%20in%20a%20working%20sheet.%26nbsp%3B%20Can't%20say%20if%20this%20is%20%22The%20Best%20Answer%22%20but%20it%20does%20%3CSTRONG%3Eexactly%3C%2FSTRONG%3E%20what%20I%20want!!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThx%20for%20the%20help%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I am working with Office Online (365) and trying to select the percentage from a table based on the total miles and total money earned from another table.

Percentage matrix.png

* miles are in column B, money is listed in row 2

 

Miles and Money.png

* Total Miles are in column E and driver names start on row 20.

 

I found a site that helped me construct this formula:

=INDEX(C6:H12,MATCH(E20,B6:B12,1),MATCH(F20,C4:H4,1))

Unfortunately, the only results returned are #N/A.  

 

What have I missed in creating my formula?  Is there a better way?

3 Replies

@DarrMik 

Change the values in the MILES column to

0

1201

1751

2151

2551

2951

3251

Change the values in the money row to

 

0   5001   6001   7001   8501   9501

 

Use

 

=INDEX($C$6:$H$12,MATCH(E20,$B$6:$B$12),MATCH(F20,$C$4:$H$4))

 

P.S. you mention "money is listed in row 2" but your formula uses C4:H4. One of those is incorrect.

best response confirmed by DarrMik (Occasional Contributor)
Solution

@DarrMik Since you mention to be working in the online version for Excel, you can use XMATCH and some dynamic array functionality. Created a mockup of your schedule to demonstrate this.

 

Note that I used named ranges (created in the desktop version) to keep the formulae easier to read. Although you can't create new or change existing named ranges in the online version, you can work with them in Excel for the Web. Replace these named ranges by absolute cell references (e.g. "grid" would become $C$4:$H$10 in the attached example) if you do not have access to Excel for the desktop to change them. Also used some custom formatting for the row and column headers.

@Riny_van_Eekelen 

 

The mock up was very helpful in testing my actual values in a working sheet.  Can't say if this is "The Best Answer" but it does exactly what I want!!

 

Thx for the help