index and match Mid in a array

nihad

New Member
Joined
Feb 24, 2021
Messages
40
Office Version
  1. 365
Platform
  1. Windows
Hi everyone

is it possible to look for a value based on search value to be Mid and array to be Mid as well?

Excel Formula:
=INDEX(MID(AG6:AG160,6,6),MATCH(AF162,MID(AF6:AF160,6,6),0))

I have tried this but I get #N/A

My search value is column AF162 Mid 6,6 and my array table is AG6:AG160 but Mid 6,6, column index is AG

Many thanks
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi & welcome to MrExcel.
That is possible, can you post some sample data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
here is an example

I have the debits on column AG, I want to create the creates based on search value on column AF "305-01"

THanks

1.4 Standard Fees Recharge Journal Feb 2021.xlsx
AEAFAGAH
5DescriptionAccount CodeDebitCredit
116Pension Admin6935-305-0150.25
117Pension Admin6935-305-04-
118Pension Admin6935-305-0212.08
271Pension Admin7935-305-01
272Pension Admin7935-305-04
273Pension Admin7935-305-02
315Pension Admin7935-362-01
Rchrg Feb21
Cell Formulas
RangeFormula
AG116:AG118AG116=ROUND(I116,2)
AF116:AF118AF116=6935&"-"&B116&"-0"&C116
AF271:AF273,AF315AF271=79&""&MID(AF116,3,9)
 
Upvote 0
Why are you trying to use the mid function of col AG?
 
Upvote 0
I could use RIGHT function
to identify the search values my nominal accounts starts with 6935-xxx-xx therefore I want my search values based on xxx-xx
for example I have 305-01 , 305-02, 305-04 , I also have 330-01 etc
 
Upvote 0
That is column AF, I am asking why you are using MID on column AG?
 
Upvote 0
Oh good point I don't actually need MID function on column AG
 
Upvote 0
Does it work if you remove it?
 
Upvote 0
YAY it works now:
Excel Formula:
=INDEX($AG$6:$AG$160,MATCH(MID(AF273,6,6),(MID($AF$6:$AF$160,6,6))))

However if you look at AH273 it returns the value from AG116,
it should return the value from AG118

what wrong am I doing?

Thanks

1.4 Standard Fees Recharge Journal Feb 2021.xlsx
AEAFAGAH
5DescriptionAccount CodeDebitCredit
116Pension Admin6935-305-0150.25
117Pension Admin6935-305-04-
118Pension Admin6935-305-0212.08
271Pension Admin7935-305-0150.25
272Pension Admin7935-305-040
273Pension Admin7935-305-0250.25
315Pension Admin7935-362-017.69
Rchrg Feb21
Cell Formulas
RangeFormula
AG116:AG118AG116=ROUND(I116,2)
AF116:AF118AF116=6935&"-"&B116&"-0"&C116
AF271:AF273,AF315AF271=79&""&MID(AF116,3,9)
AH271:AH273,AH315AH271=INDEX($AG$6:$AG$160,MATCH(MID(AF271,6,6),(MID($AF$6:$AF$160,6,6))))
 
Upvote 0
Ah just answered my question, I should have done exact match.

Excel Formula:
=INDEX($AG$6:$AG$160,MATCH(MID(AF271,6,6),(MID($AF$6:$AF$160,6,6)),0))
 
Upvote 0

Forum statistics

Threads
1,215,470
Messages
6,124,993
Members
449,201
Latest member
Lunzwe73

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