Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default lookup to see if multiple values exist

Hi,

I am faced with this problem. I have data as follows:

Col1 Col2 Col3
S1 H1 Value 1
S1 H2 Value 2
S2 H1 Value 3
S2 H2 Value 3

I need to roll this data up so that I get
ColR1 ColR2
S1 "Multiple"
S2 Value3

Basically if S1 has multiple values then shown "Multiple". If it has the
same value for all occurrences, as is the case for S2, show that value.

These are formulas with dynamic data which I need to calculate
automatically. I cannot use a pivot table. I do not want to use a macro
unless I have to.

I tried to think of a logic saying if min(value)<max(value), but these
functions only work with numeric data.

Please help.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 83
Default lookup to see if multiple values exist

On Mon, 10 May 2010 13:49:01 -0700, Yegod
wrote:

Hi,

I am faced with this problem. I have data as follows:

Col1 Col2 Col3
S1 H1 Value 1
S1 H2 Value 2
S2 H1 Value 3
S2 H2 Value 3

I need to roll this data up so that I get
ColR1 ColR2
S1 "Multiple"
S2 Value3

Basically if S1 has multiple values then shown "Multiple". If it has the
same value for all occurrences, as is the case for S2, show that value.

These are formulas with dynamic data which I need to calculate
automatically. I cannot use a pivot table. I do not want to use a macro
unless I have to.

I tried to think of a logic saying if min(value)<max(value), but these
functions only work with numeric data.

Please help.


Assuming Col1 = A, Col2 =B, Col3 = C
(actually Col2 is of no interest here)

Assuming ColR1 = D, ColR2 = E

Assuming that there is a header row so the real data table starts on
row 2 (and in the example goes down to row 5).

Try the following formula in Cell E2

=IF(SUMPRODUCT((A$2:A$5=D2)*(C$2:C$5<VLOOKUP(D2,A $2:C$5,3,FALSE))),"Multiple",VLOOKUP(D2,A$2:C$5,3, FALSE))

Change the 5 in all places to fit the size of your data table.

Copy the formula down column E as far as you have data in column D.

The SUMPRODUCT part of the formula counts all occations of "S" that
have a different "Value" than the one the VLOOKUP first finds.
If the result of the SUMPRODUCT is more than 0, that means that there
are "Multiple" Values. If the result is 0 we just return the value
found by VLOOKUP.

Hope this helps / Lars-Åke


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default lookup to see if multiple values exist

Fantastic, that works!

Thank you!!!

"Lars-Ã…ke Aspelin" wrote:

On Mon, 10 May 2010 13:49:01 -0700, Yegod
wrote:

Hi,

I am faced with this problem. I have data as follows:

Col1 Col2 Col3
S1 H1 Value 1
S1 H2 Value 2
S2 H1 Value 3
S2 H2 Value 3

I need to roll this data up so that I get
ColR1 ColR2
S1 "Multiple"
S2 Value3

Basically if S1 has multiple values then shown "Multiple". If it has the
same value for all occurrences, as is the case for S2, show that value.

These are formulas with dynamic data which I need to calculate
automatically. I cannot use a pivot table. I do not want to use a macro
unless I have to.

I tried to think of a logic saying if min(value)<max(value), but these
functions only work with numeric data.

Please help.


Assuming Col1 = A, Col2 =B, Col3 = C
(actually Col2 is of no interest here)

Assuming ColR1 = D, ColR2 = E

Assuming that there is a header row so the real data table starts on
row 2 (and in the example goes down to row 5).

Try the following formula in Cell E2

=IF(SUMPRODUCT((A$2:A$5=D2)*(C$2:C$5<VLOOKUP(D2,A $2:C$5,3,FALSE))),"Multiple",VLOOKUP(D2,A$2:C$5,3, FALSE))

Change the 5 in all places to fit the size of your data table.

Copy the formula down column E as far as you have data in column D.

The SUMPRODUCT part of the formula counts all occations of "S" that
have a different "Value" than the one the VLOOKUP first finds.
If the result of the SUMPRODUCT is more than 0, that means that there
are "Multiple" Values. If the result is 0 we just return the value
found by VLOOKUP.

Hope this helps / Lars-Ã…ke


.

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
Does a formula exist that will lookup on ALL tabs, not just one. JLS Excel Discussion (Misc queries) 5 April 10th 10 07:28 AM
Multiple lookup values and adding multiple rates across together ssolomon Excel Worksheet Functions 5 November 16th 07 09:02 PM
Lookup in Multiple Columns, Return Multiple Values andy62 Excel Worksheet Functions 3 July 6th 06 02:36 AM
Returning the desired value if multiple values exist???? njuneardave Excel Worksheet Functions 1 June 21st 06 08:32 PM
Getting #N/A from Vlookup when matching value exist in the lookup data range. jdeshpa Excel Worksheet Functions 2 November 22nd 05 09:12 PM


All times are GMT +1. The time now is 06:29 PM.

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

About Us

"It's about Microsoft Excel"