Unable To Use Match Function With Export Data Point

DR RENO

Board Regular
Joined
Jun 29, 2018
Messages
65
Exporting USDA data for a proprietary spreadsheet , but unable to match the 4-digit Year column data formatting with it's appropriate reference cell. Other column data matches (State, Commodity, etc). Character length is equal as they each are four characters. However the cells do not equal unless I use the Trim function.

I tried the trim/clean copy and paste values with no success. If I nest Trim function inside Match it doesn't math. CODE=50

Any tips? Side note - Ultimately I will be using multiple match criteria for three variable (Year, State, Period). For the latter I need to use a LEFT function array to capture the last three characters. That formula does work for me.

1st time posting, but have reviewed many of your posts for years to solve Excel and VBA troubles. You guys are pretty amazing
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi Reno,

You can confirm real numbers in a column with;
Code:
=isnumber(a1)

I like to use the following to remove spaces and convert to number;
Code:
=VALUE(TRIM(CLEAN(A1)))
 
Upvote 0

=LEFT(C1,4)
2012/2013
DEC
MT
Montana
=INDEX('Sep Corn Stocks'!$A$2:$T$53,MATCH(1,'Sep Corn Stocks'!$F$2:$F$53=Corn!B3)*('Sep Corn Stocks'!$B$2:$B$53=VALUE(TRIM(CLEAN($B$1)))),20)
ND
North Dakota
=INDEX('Sep Corn Stocks'!$A$2:$T$53,MATCH(1,'Sep Corn Stocks'!$F$2:$F$53=Corn!B4)*('Sep Corn Stocks'!$B$2:$B$53=VALUE(TRIM(CLEAN($B$1)))),20)
MN
Minnesota
=INDEX('Sep Corn Stocks'!$A$2:$T$53,MATCH(1,'Sep Corn Stocks'!$F$2:$F$53=Corn!B5)*('Sep Corn Stocks'!$B$2:$B$53=VALUE(TRIM(CLEAN($B$1)))),20)
SD
South Dakota
=INDEX('Sep Corn Stocks'!$A$2:$T$53,MATCH(1,'Sep Corn Stocks'!$F$2:$F$53=Corn!B6)*('Sep Corn Stocks'!$B$2:$B$53=VALUE(TRIM(CLEAN($B$1)))),20)
Total
=SUM(C3:C6)

<tbody>
</tbody>

<tbody>
</tbody>
Actually it appears that I spoke too soon. Thanks to your formula I can create an Index/Match function that correctly captures expected value, however when I expand Match to be multi-variables I'm getting #NA . I've independently checked each variable and they will work inside Index/Match, but when I try to expand function, it's not cooperating. I'm new on here, so maybe this should be new thread.
 
Upvote 0
This match syntax doesn't look right it should be lookup_value,lookup_array,[match type]. [FONT=&quot]MATCH(1,'Sep Corn Stocks'!$F$2:$F$53=Corn!B3).[/FONT] By itself this will always result in #NA .

There's a few problems with this index match, I think a sumproduct or sumif formula would be better suited to your end goal, are you able to get any sample data so we can work it out?
 
Upvote 0
RasGhul - Apologize for not responding sooner. Was off on holiday yesterday and didn't check email.

I have now solved this issue, so I'm good. Thank you for all of your help
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,557
Members
449,088
Latest member
davidcom

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