Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I need to look up a value that meets 2 criteria.
My data is like this ..Code.........|Week.....|....Important Data !! OMG | 1 | XX AFK | 2 | XX OMG | 2 | XX AFK | 3 | XX OMG | 4 | XX Where there is no data for a week or code I want a blank cell left in the template below. Where there is a match I want the €śImportant Data€ť returned. Code Code .......OMG........|.....AFK...... Week1| XX | Week2| XX | XX Week3| | XX Week4| XX | Im all out of ideas?? |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
With the sample data you have provided try the below formula...Please note
that this is an array formula. You create array formulas in the same way that you create other formulas, except you press CTRL+SHIFT+ENTER to enter the formula. If successful in 'Formula Bar' you can notice the curly braces at both ends like "{=<formula}" =INDEX($C$2:$C$10,MATCH(1,($A$2:$A$10="OMG")*($B$2 :$B$10=1),0)) 'data in sheet1 Col A Col B Col C Code Week Imp data OMG 1 a AFK 2 b OMG 2 c AFK 3 d OMG 4 e The formula is a bit lengthy after adding error handling to return blank....With your data in Sheet1; I have tried this in Sheet2 as below..try the below formula in cell B2. 'in sheet2 Col A Col B Col C OMG AFK Week1 a Week2 c b Week3 d Week4 e Week5 =IF(ISNA(INDEX(Sheet1!$C$2:$C$10,MATCH(1,(Sheet1!$ A$2:$A$10=B$1)*(Sheet1!$B$2:$B$10=--SUBSTITUTE($A2,"Week",)),0))),"",INDEX(Sheet1!$C$2 :$C$10,MATCH(1,(Sheet1!$A$2:$A$10=B$1)*(Sheet1!$B$ 2:$B$10=--SUBSTITUTE($A2,"Week",)),0))) PS: again an array formula If this post helps click Yes --------------- Jacob Skaria "Vader" wrote: I need to look up a value that meets 2 criteria. My data is like this .Code.........|Week.....|....Important Data !! OMG | 1 | XX AFK | 2 | XX OMG | 2 | XX AFK | 3 | XX OMG | 4 | XX Where there is no data for a week or code I want a blank cell left in the template below. Where there is a match I want the €śImportant Data€ť returned. Code Code .......OMG........|.....AFK...... Week1| XX | Week2| XX | XX Week3| | XX Week4| XX | Im all out of ideas?? |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
The formula is a bit lengthy after adding error
handling to return blank.... If the data being returned is TEXT (array entered): =LOOKUP(REPT("z",255),CHOOSE({1,2},"",INDEX($C$2:$ C$10,MATCH(1,($A$2:$A$10="OMG")*($B$2:$B$10=1),0)) )) Or, possibly (array entered): =LOOKUP("zzzzz",CHOOSE({1,2},"",INDEX($C$2:$C$10,M ATCH(1,($A$2:$A$10="OMG")*($B$2:$B$10=1),0)))) =IF(ISNA(INDEX(Sheet1!$C$2:$C$10,MATCH(1... In these cases there's no need to include INDEX in the error trap. The portion of the formula that will generate the error is MATCH(1... So this should suffice: =IF(ISNA(MATCH(1... -- Biff Microsoft Excel MVP "Jacob Skaria" wrote in message ... With the sample data you have provided try the below formula...Please note that this is an array formula. You create array formulas in the same way that you create other formulas, except you press CTRL+SHIFT+ENTER to enter the formula. If successful in 'Formula Bar' you can notice the curly braces at both ends like "{=<formula}" =INDEX($C$2:$C$10,MATCH(1,($A$2:$A$10="OMG")*($B$2 :$B$10=1),0)) 'data in sheet1 Col A Col B Col C Code Week Imp data OMG 1 a AFK 2 b OMG 2 c AFK 3 d OMG 4 e The formula is a bit lengthy after adding error handling to return blank....With your data in Sheet1; I have tried this in Sheet2 as below..try the below formula in cell B2. 'in sheet2 Col A Col B Col C OMG AFK Week1 a Week2 c b Week3 d Week4 e Week5 =IF(ISNA(INDEX(Sheet1!$C$2:$C$10,MATCH(1,(Sheet1!$ A$2:$A$10=B$1)*(Sheet1!$B$2:$B$10=--SUBSTITUTE($A2,"Week",)),0))),"",INDEX(Sheet1!$C$2 :$C$10,MATCH(1,(Sheet1!$A$2:$A$10=B$1)*(Sheet1!$B$ 2:$B$10=--SUBSTITUTE($A2,"Week",)),0))) PS: again an array formula If this post helps click Yes --------------- Jacob Skaria "Vader" wrote: I need to look up a value that meets 2 criteria. My data is like this .Code.........|Week.....|....Important Data !! OMG | 1 | XX AFK | 2 | XX OMG | 2 | XX AFK | 3 | XX OMG | 4 | XX Where there is no data for a week or code I want a blank cell left in the template below. Where there is a match I want the "Important Data" returned. Code Code .......OMG........|.....AFK...... Week1| XX | Week2| XX | XX Week3| | XX Week4| XX | Im all out of ideas?? |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I usually use the error checking method so the formula I use is like this:
=IF(ISERROR(vlookup(B2,data_range,3,false)),"",vlo okup(b2,data_range,3,false)) It tries to do the vlookup based on the criteria you want, if there is nothing to return, your vlookup will return an error so I use the IF(ISERROR routein to enter a null ("") when the vlookup fails. If the vllokup formula is not in error, then it will return whatever it was supposed to return from the data_range. I'm sorry I'm not good at explaining but I hope you get the gist of what I was doing with the error checking routein. Good Luck. Ashish "Vader" wrote: I need to look up a value that meets 2 criteria. My data is like this .Code.........|Week.....|....Important Data !! OMG | 1 | XX AFK | 2 | XX OMG | 2 | XX AFK | 3 | XX OMG | 4 | XX Where there is no data for a week or code I want a blank cell left in the template below. Where there is a match I want the €śImportant Data€ť returned. Code Code .......OMG........|.....AFK...... Week1| XX | Week2| XX | XX Week3| | XX Week4| XX | Im all out of ideas?? |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks Jacob,
The formula works prefect, But i have 1 more question now. In a cell i need to add up 2 other cells + the result of the formula. eg . in a cell i have "=B2+C2+E2" the result i get is #VALUE! B2= a number C2= a number E2= the formula which could be either a number it has found or blank. Do you have any suggestions? Vader "Jacob Skaria" wrote: With the sample data you have provided try the below formula...Please note that this is an array formula. You create array formulas in the same way that you create other formulas, except you press CTRL+SHIFT+ENTER to enter the formula. If successful in 'Formula Bar' you can notice the curly braces at both ends like "{=<formula}" =INDEX($C$2:$C$10,MATCH(1,($A$2:$A$10="OMG")*($B$2 :$B$10=1),0)) 'data in sheet1 Col A Col B Col C Code Week Imp data OMG 1 a AFK 2 b OMG 2 c AFK 3 d OMG 4 e The formula is a bit lengthy after adding error handling to return blank....With your data in Sheet1; I have tried this in Sheet2 as below..try the below formula in cell B2. 'in sheet2 Col A Col B Col C OMG AFK Week1 a Week2 c b Week3 d Week4 e Week5 =IF(ISNA(INDEX(Sheet1!$C$2:$C$10,MATCH(1,(Sheet1!$ A$2:$A$10=B$1)*(Sheet1!$B$2:$B$10=--SUBSTITUTE($A2,"Week",)),0))),"",INDEX(Sheet1!$C$2 :$C$10,MATCH(1,(Sheet1!$A$2:$A$10=B$1)*(Sheet1!$B$ 2:$B$10=--SUBSTITUTE($A2,"Week",)),0))) PS: again an array formula If this post helps click Yes --------------- Jacob Skaria "Vader" wrote: I need to look up a value that meets 2 criteria. My data is like this .Code.........|Week.....|....Important Data !! OMG | 1 | XX AFK | 2 | XX OMG | 2 | XX AFK | 3 | XX OMG | 4 | XX Where there is no data for a week or code I want a blank cell left in the template below. Where there is a match I want the €śImportant Data€ť returned. Code Code .......OMG........|.....AFK...... Week1| XX | Week2| XX | XX Week3| | XX Week4| XX | Im all out of ideas?? |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
in a cell i have "=B2+C2+E2" the result i get is #VALUE!
Use the SUM function: =SUM(B2,C2,E2) The SUM function ignores text which is what a formula blank ("") is. -- Biff Microsoft Excel MVP "Vader" wrote in message ... Thanks Jacob, The formula works prefect, But i have 1 more question now. In a cell i need to add up 2 other cells + the result of the formula. eg . in a cell i have "=B2+C2+E2" the result i get is #VALUE! B2= a number C2= a number E2= the formula which could be either a number it has found or blank. Do you have any suggestions? Vader "Jacob Skaria" wrote: With the sample data you have provided try the below formula...Please note that this is an array formula. You create array formulas in the same way that you create other formulas, except you press CTRL+SHIFT+ENTER to enter the formula. If successful in 'Formula Bar' you can notice the curly braces at both ends like "{=<formula}" =INDEX($C$2:$C$10,MATCH(1,($A$2:$A$10="OMG")*($B$2 :$B$10=1),0)) 'data in sheet1 Col A Col B Col C Code Week Imp data OMG 1 a AFK 2 b OMG 2 c AFK 3 d OMG 4 e The formula is a bit lengthy after adding error handling to return blank....With your data in Sheet1; I have tried this in Sheet2 as below..try the below formula in cell B2. 'in sheet2 Col A Col B Col C OMG AFK Week1 a Week2 c b Week3 d Week4 e Week5 =IF(ISNA(INDEX(Sheet1!$C$2:$C$10,MATCH(1,(Sheet1!$ A$2:$A$10=B$1)*(Sheet1!$B$2:$B$10=--SUBSTITUTE($A2,"Week",)),0))),"",INDEX(Sheet1!$C$2 :$C$10,MATCH(1,(Sheet1!$A$2:$A$10=B$1)*(Sheet1!$B$ 2:$B$10=--SUBSTITUTE($A2,"Week",)),0))) PS: again an array formula If this post helps click Yes --------------- Jacob Skaria "Vader" wrote: I need to look up a value that meets 2 criteria. My data is like this .Code.........|Week.....|....Important Data !! OMG | 1 | XX AFK | 2 | XX OMG | 2 | XX AFK | 3 | XX OMG | 4 | XX Where there is no data for a week or code I want a blank cell left in the template below. Where there is a match I want the "Important Data" returned. Code Code .......OMG........|.....AFK...... Week1| XX | Week2| XX | XX Week3| | XX Week4| XX | Im all out of ideas?? |
#7
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Ok 1 last update on this formula.
Im using Jacobs formula =IF(ISNA(INDEX(Sheet1!$C$2:$C$10,MATCH(1,(Sheet1!$ A$2:$A$10=B$1)*(Sheet1!$B$2:$B$10=--SUBSTITUTE($A2,"Week",)),0))),"",INDEX(Sheet1!$C$2 :$C$10,MATCH(1,(Sheet1!$A$2:$A$10=B$1)*(Sheet1!$B$ 2:$B$10=--SUBSTITUTE($A2,"Week",)),0))) But i also need the formula to add up the number it finds in coloum C if their are 2 hits. I used leters in the example but the important date being found is a numbe or 2. "Jacob Skaria" wrote: With the sample data you have provided try the below formula...Please note that this is an array formula. You create array formulas in the same way that you create other formulas, except you press CTRL+SHIFT+ENTER to enter the formula. If successful in 'Formula Bar' you can notice the curly braces at both ends like "{=<formula}" =INDEX($C$2:$C$10,MATCH(1,($A$2:$A$10="OMG")*($B$2 :$B$10=1),0)) 'data in sheet1 Col A Col B Col C Code Week Imp data OMG 1 a AFK 2 b OMG 2 c AFK 3 d OMG 4 e The formula is a bit lengthy after adding error handling to return blank....With your data in Sheet1; I have tried this in Sheet2 as below..try the below formula in cell B2. 'in sheet2 Col A Col B Col C OMG AFK Week1 a Week2 c b Week3 d Week4 e Week5 =IF(ISNA(INDEX(Sheet1!$C$2:$C$10,MATCH(1,(Sheet1!$ A$2:$A$10=B$1)*(Sheet1!$B$2:$B$10=--SUBSTITUTE($A2,"Week",)),0))),"",INDEX(Sheet1!$C$2 :$C$10,MATCH(1,(Sheet1!$A$2:$A$10=B$1)*(Sheet1!$B$ 2:$B$10=--SUBSTITUTE($A2,"Week",)),0))) PS: again an array formula If this post helps click Yes --------------- Jacob Skaria "Vader" wrote: I need to look up a value that meets 2 criteria. My data is like this .Code.........|Week.....|....Important Data !! OMG | 1 | XX AFK | 2 | XX OMG | 2 | XX AFK | 3 | XX OMG | 4 | XX Where there is no data for a week or code I want a blank cell left in the template below. Where there is a match I want the €śImportant Data€ť returned. Code Code .......OMG........|.....AFK...... Week1| XX | Week2| XX | XX Week3| | XX Week4| XX | Im all out of ideas?? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VLookUp - Does the VLookUp return the exact information? | Excel Worksheet Functions | |||
Vlookup in vlookup - taking the result as array name | Excel Worksheet Functions | |||
Combine VLOOKUP and IF function so #NA isn't returned as a value from VLOOKUP | Excel Discussion (Misc queries) | |||
Vlookup -=VLOOKUP(F9,LookUp1!$A$2:$B$1504,2,FALSE) | New Users to Excel | |||
Vlookup info being used without vlookup table attached? | Excel Worksheet Functions |