Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Match, Index and CSV

Hello,

On the cell H3 I have teh following:
=IF(ISNA(INDEX(B$47:K$52;MATCH($E3;B$47:B$52;0);5) ); 0; INDEX(B$47:K
$52;MATCH($E3;B$47:B$52;0);5))

Basically, it looks for a match of E3 value in range B$47:B$52 and
gets the value the 5th column.

At the moment a possible value of E3 is "COM".
And there is only one "COM" value in the range list.

What I would like is in E3 to be able to have "COM" or "COM,NET".

When there are two values in E3 I would get the SUM of the values of
the 5th column in the range that match the values COM and NET.

How can I change my code to do this?

Thanks,
Miguel
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Match, Index and CSV


First off, if I understand what you originally wanted correctly, this
formula would have done what your first formula did...

=SUMPRODUCT((B47:B52=E3)*F47:F52)

Note that if the value in E3 appeared in F47:F52 more than once, then all
values from Column F in the row where the matches took place would be
summed; however, you said there was only one occurrence, so this shouldn't
really matter to you (I just mentioned it for completeness sake). Now, for
your current question, I think this formula will do what you want...

=SUMPRODUCT(ISNUMBER(SEARCH(","&B47:B52&",";","&E3 &","))*F47:F52)

Note that is has the same multiple cell functionality as the above formula
(but again, you said there would only be one occurrence of each key word in
F47:F52, so again, this shouldn't matter to you).

--
Rick (MVP - Excel)


"shapper" wrote in message
...
Hello,

On the cell H3 I have teh following:
=IF(ISNA(INDEX(B$47:K$52;MATCH($E3;B$47:B$52;0);5) ); 0; INDEX(B$47:K
$52;MATCH($E3;B$47:B$52;0);5))

Basically, it looks for a match of E3 value in range B$47:B$52 and
gets the value the 5th column.

At the moment a possible value of E3 is "COM".
And there is only one "COM" value in the range list.

What I would like is in E3 to be able to have "COM" or "COM,NET".

When there are two values in E3 I would get the SUM of the values of
the 5th column in the range that match the values COM and NET.

How can I change my code to do this?

Thanks,
Miguel


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Match, Index and CSV

On Nov 8, 5:26*pm, "Rick Rothstein"
wrote:
First off, if I understand what you originally wanted correctly, this
formula would have done what your first formula did...

=SUMPRODUCT((B47:B52=E3)*F47:F52)


Your suggestions are really good and I am updating my code. I have a
problem with this one:
=(B$41:B$44=D3)*E$41:E$44

Note: In my worksheet cells B41 to B44 are always merged with its
correspondent C cell.
So B41 is merged with C41, B42 is merged with C42, and so on.
Is this causing some problem in my formular?

Note that if the value in E3 appeared in F47:F52 more than once, then all
values from Column F in the row where the matches took place would be
summed; however, you said there was only one occurrence, so this shouldn't
really matter to you (I just mentioned it for completeness sake). Now, for
your current question, I think this formula will do what you want...

=SUMPRODUCT(ISNUMBER(SEARCH(","&B47:B52&",";","&E3 &","))*F47:F52)


This worked fine. I just needed a second term:

=SUMPRODUCT(ISNUMBER(SEARCH(","&B$47:B$52&",";","& E3&","))*F$47:F$52)
+ SUMPRODUCT(ISNUMBER(SEARCH(","&B$47:B$52&",";","&E 3&","))*G$47:G
$52/$I$26)

Basically I am also getting the values in G columns but these ones
must be divided by I26 and then I sum both terms.

Is there a way to simplify this code even more?

Thank You,
Miguel
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,104
Default Match, Index and CSV


If you are always add what is in column F
=SUMPRODUCT((B47:B52=LEFT(E3,3))+((B47:B52=RIGHT(E 3,3))*LEN(E3)=7),F47:F52)

If you want to control the column F is column 6)
=SUMPRODUCT(((B47:B52=LEFT(E3,3))+((B47:B52=RIGHT( E3,3))*LEN(E3)=7))*(COLUMN(C47:K52)=6)*C47:K52)

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email


"shapper" wrote in message
...
Hello,

On the cell H3 I have teh following:
=IF(ISNA(INDEX(B$47:K$52;MATCH($E3;B$47:B$52;0);5) ); 0; INDEX(B$47:K
$52;MATCH($E3;B$47:B$52;0);5))

Basically, it looks for a match of E3 value in range B$47:B$52 and
gets the value the 5th column.

At the moment a possible value of E3 is "COM".
And there is only one "COM" value in the range list.

What I would like is in E3 to be able to have "COM" or "COM,NET".

When there are two values in E3 I would get the SUM of the values of
the 5th column in the range that match the values COM and NET.

How can I change my code to do this?

Thanks,
Miguel



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find Exact Match using INDEX, MATCH DoubleUU Excel Worksheet Functions 3 August 15th 08 02:42 PM
index(match) Wind Uplift Calculations (match four conditions) JMeier Excel Worksheet Functions 8 August 1st 08 01:45 AM
index match array function-returning only first match, need last. Julie Olsen Excel Worksheet Functions 3 December 29th 06 12:50 AM
How do I display more than one match in a Index/Match formula? Trish Excel Worksheet Functions 0 September 26th 05 10:21 PM
index,match,match on un-sorted data Brisbane Rob Excel Worksheet Functions 3 September 24th 05 10:04 PM


All times are GMT +1. The time now is 02:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"