Sumproduct And Right Function

srizki

Well-known Member
Joined
Jan 14, 2003
Messages
1,840
Office Version
  1. 365
Platform
  1. Windows
I trying to match two columns of one table to two column of another in another workbook. One of the columns that needs to be matched has number with other numbers and I need only to match the four numbers at far end, therefore I used this formula.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p> </o:p>
=SUMPRODUCT(--('[Capital Expenditures & Approvals Report-0308.xls]Capital Approvals'!$B$7:$B$1188=D10)*('[Capital Expenditures & Approvals Report-0308.xls]Capital Approvals'!$C$7:$C$1188=RIGHT(B10,4)*'[Capital Expenditures & Approvals Report-0308.xls]Capital Approvals'!$N$7:$N$1188))<o:p></o:p>
<o:p> </o:p>
Explanation, the two sheets are “Capital Expenditure & Approval Report”, and “<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:eek:ffice:smarttags" /><st1:PersonName w:st="on">Ken</st1:PersonName> Report”, my formula is in <st1:PersonName w:st="on">Ken</st1:PersonName> report and the report has number like 18600-1413 and I need to match only 1413. <o:p></o:p>
The formula above works perfectly if I do not have to use =RIGHT function.<o:p></o:p>
<o:p> </o:p>
How can I ammend the formula to work.<o:p></o:p>
<o:p> </o:p>
Thanks.<o:p></o:p>
Sohail
 
I am sorry Domenic,

I made it little too complicated,
What it is that, I send a file to different users to input their comments in column M, comments like, "Completed", "In Process", "estimated complete date 08/2008", etc. When they send me back with comments, I want to put those comments on master file, to do that I match Account number in Column B and Project ID in column D in both the files user input file and the master file. So the formula should match these two values, value are text, and bring comments from column M of user file to master file. (Obviously formuls is on master file in column M).

I hope I presented it better this time.

Thanks
 
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Can you provide a small sample of the data, along with an example?
 
Upvote 0
<SCRIPT language=JavaScript src="http://www.interq.or.jp/sun/puremis...[/XD][XH][/XH][/XR][/RANGE][/XH][/XR][/RANGE]
 
Upvote 0
Try...

MF!E2, confirmed with CONTROL+SHIFT+ENTER, and copied down:

=INDEX(User!$E$2:$E$11,MATCH(1,IF(RIGHT(User!$A$2:$A$11,4)=RIGHT(MF!A2,4),IF(User!$B$2:$B$11=MF!B2,1)),0))

To trap errors that may occur when no match occurs, try...

MF!E2, confirmed with CONTROL+SHIFT+ENTER, and copied down:

=LOOKUP(REPT("z",255),CHOOSE({1,2},"",INDEX(User!$E$2:$E$11,MATCH(1,IF(RIGHT(User!$A$2:$A$11,4)=RIGHT(MF!A2,4),IF(User!$B$2:$B$11=MF!B2,1)),0))))

Hope this helps!
 
Upvote 0
Thanks Domenic,
I have not tried it yet, but why RIGHT function, when column A has same account numbers in both of the sheets. also in full sheet there are some account numbers that have right (cost centers) same and first five numbers are different, ie, cost center could be in more than one accout number, eg., 186000-1613, or 18700-1613, (6 and 7 in account numbers are years, 2006, 2007).

I will try these formulas

Thanks again Domenic.
 
Upvote 0
Domenic, I used your Index formula with some adjustments, I used,
{=INDEX(USER E2:E11,MATCH(MF A2&B2,USER A2:A11&B2:B11,0))}

This worked with #N/A error where there are no match found, can you please refine this formula, so that I will not get the error.

I want to use SUMPRODUCT.
your help is appreciated.

Thanks
sohail
 
Last edited:
Upvote 0
I have not tried it yet, but why RIGHT function, when column A has same account numbers in both of the sheets.

If you're looking for an exact match on the whole account number, the RIGHT function is not needed.

{=INDEX(USER E2:E11,MATCH(MF A2&B2,USER A2:A11&B2:B11,0))}

This worked with #N/A error where there are no match found, can you please refine this formula, so that I will not get the error.

=LOOKUP(REPT("z",255),CHOOSE({1,2},"",INDEX(USER!E2:E11,MATCH(MF!A2&B2,USER!A2:A11&B2:B11,0))))

...confirmed with CONTROL+SHIFT+ENTER.

I want to use SUMPRODUCT.

SUMPRODUCT cannot be used to return text...
 
Upvote 0
It is working excellent, this what I wanted, though I did not understand the for part completely.
 
Upvote 0

Forum statistics

Threads
1,214,577
Messages
6,120,359
Members
448,956
Latest member
Adamsxl

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