![]() |
Match Function
Hi,
I have put together a spreadsheet to find codes, states, descriptions. It finds the data by dates. Columns a Dates, Codes, States, Descriptions If I put in a date it matches the code, state and description. My problem is that if I have 2 dates that are the same it will only match the first date it can find. What kind of formula do I need so that it will output the second or third date data. Thanks for your help. If you need a copy of the spreadsheet please let me know. |
Match Function
How many rows of data do you have?
-- Biff Microsoft Excel MVP "Melanie" wrote in message ... Hi, I have put together a spreadsheet to find codes, states, descriptions. It finds the data by dates. Columns a Dates, Codes, States, Descriptions If I put in a date it matches the code, state and description. My problem is that if I have 2 dates that are the same it will only match the first date it can find. What kind of formula do I need so that it will output the second or third date data. Thanks for your help. If you need a copy of the spreadsheet please let me know. |
Match Function
Lots - over 300 at the moment and it gets added to all the time.
"T. Valko" wrote: How many rows of data do you have? -- Biff Microsoft Excel MVP "Melanie" wrote in message ... Hi, I have put together a spreadsheet to find codes, states, descriptions. It finds the data by dates. Columns a Dates, Codes, States, Descriptions If I put in a date it matches the code, state and description. My problem is that if I have 2 dates that are the same it will only match the first date it can find. What kind of formula do I need so that it will output the second or third date data. Thanks for your help. If you need a copy of the spreadsheet please let me know. |
Match Function
One way...
Assume your data is in the range A2:D500 F2:H2 = headers: Code, State, Description F1 = lookup date Enter this formula in G1. This will return the count of dates based on the date entered in cell F1: =COUNTIF(A:A,F1) Enter this array formula** in F3: =IF(ROWS(F$3:F3)<=$G$1,INDEX(B$2:B$500,SMALL(IF($A $2:$A$500=$F$1,ROW(B$2:B$500)),ROWS(F$3:F3))-ROW(B$2)+1),"") ** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER. Copy across to H3 then down to a number of rows that ensures you get all the results. How many rows that is depends on the maximum count for any single date. For example, if 1/1/2009 appears the most times, let's say it appears 5 times, then you need to copy the formula to at least 5 rows. -- Biff Microsoft Excel MVP "Melanie" wrote in message ... Lots - over 300 at the moment and it gets added to all the time. "T. Valko" wrote: How many rows of data do you have? -- Biff Microsoft Excel MVP "Melanie" wrote in message ... Hi, I have put together a spreadsheet to find codes, states, descriptions. It finds the data by dates. Columns a Dates, Codes, States, Descriptions If I put in a date it matches the code, state and description. My problem is that if I have 2 dates that are the same it will only match the first date it can find. What kind of formula do I need so that it will output the second or third date data. Thanks for your help. If you need a copy of the spreadsheet please let me know. |
Match Function
I put the formulas in and the count works but the second formula gives me a
#Value Error. "T. Valko" wrote: One way... Assume your data is in the range A2:D500 F2:H2 = headers: Code, State, Description F1 = lookup date Enter this formula in G1. This will return the count of dates based on the date entered in cell F1: =COUNTIF(A:A,F1) Enter this array formula** in F3: =IF(ROWS(F$3:F3)<=$G$1,INDEX(B$2:B$500,SMALL(IF($A $2:$A$500=$F$1,ROW(B$2:B$500)),ROWS(F$3:F3))-ROW(B$2)+1),"") ** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER. Copy across to H3 then down to a number of rows that ensures you get all the results. How many rows that is depends on the maximum count for any single date. For example, if 1/1/2009 appears the most times, let's say it appears 5 times, then you need to copy the formula to at least 5 rows. -- Biff Microsoft Excel MVP "Melanie" wrote in message ... Lots - over 300 at the moment and it gets added to all the time. "T. Valko" wrote: How many rows of data do you have? -- Biff Microsoft Excel MVP "Melanie" wrote in message ... Hi, I have put together a spreadsheet to find codes, states, descriptions. It finds the data by dates. Columns a Dates, Codes, States, Descriptions If I put in a date it matches the code, state and description. My problem is that if I have 2 dates that are the same it will only match the first date it can find. What kind of formula do I need so that it will output the second or third date data. Thanks for your help. If you need a copy of the spreadsheet please let me know. |
Match Function
Did you array enter it as suggested?
-- __________________________________ HTH Bob "Melanie" wrote in message ... I put the formulas in and the count works but the second formula gives me a #Value Error. "T. Valko" wrote: One way... Assume your data is in the range A2:D500 F2:H2 = headers: Code, State, Description F1 = lookup date Enter this formula in G1. This will return the count of dates based on the date entered in cell F1: =COUNTIF(A:A,F1) Enter this array formula** in F3: =IF(ROWS(F$3:F3)<=$G$1,INDEX(B$2:B$500,SMALL(IF($A $2:$A$500=$F$1,ROW(B$2:B$500)),ROWS(F$3:F3))-ROW(B$2)+1),"") ** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER. Copy across to H3 then down to a number of rows that ensures you get all the results. How many rows that is depends on the maximum count for any single date. For example, if 1/1/2009 appears the most times, let's say it appears 5 times, then you need to copy the formula to at least 5 rows. -- Biff Microsoft Excel MVP "Melanie" wrote in message ... Lots - over 300 at the moment and it gets added to all the time. "T. Valko" wrote: How many rows of data do you have? -- Biff Microsoft Excel MVP "Melanie" wrote in message ... Hi, I have put together a spreadsheet to find codes, states, descriptions. It finds the data by dates. Columns a Dates, Codes, States, Descriptions If I put in a date it matches the code, state and description. My problem is that if I have 2 dates that are the same it will only match the first date it can find. What kind of formula do I need so that it will output the second or third date data. Thanks for your help. If you need a copy of the spreadsheet please let me know. |
Match Function
I have now. And it is now working.
Thank you so much for all your help. "Bob Phillips" wrote: Did you array enter it as suggested? -- __________________________________ HTH Bob "Melanie" wrote in message ... I put the formulas in and the count works but the second formula gives me a #Value Error. "T. Valko" wrote: One way... Assume your data is in the range A2:D500 F2:H2 = headers: Code, State, Description F1 = lookup date Enter this formula in G1. This will return the count of dates based on the date entered in cell F1: =COUNTIF(A:A,F1) Enter this array formula** in F3: =IF(ROWS(F$3:F3)<=$G$1,INDEX(B$2:B$500,SMALL(IF($A $2:$A$500=$F$1,ROW(B$2:B$500)),ROWS(F$3:F3))-ROW(B$2)+1),"") ** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER. Copy across to H3 then down to a number of rows that ensures you get all the results. How many rows that is depends on the maximum count for any single date. For example, if 1/1/2009 appears the most times, let's say it appears 5 times, then you need to copy the formula to at least 5 rows. -- Biff Microsoft Excel MVP "Melanie" wrote in message ... Lots - over 300 at the moment and it gets added to all the time. "T. Valko" wrote: How many rows of data do you have? -- Biff Microsoft Excel MVP "Melanie" wrote in message ... Hi, I have put together a spreadsheet to find codes, states, descriptions. It finds the data by dates. Columns a Dates, Codes, States, Descriptions If I put in a date it matches the code, state and description. My problem is that if I have 2 dates that are the same it will only match the first date it can find. What kind of formula do I need so that it will output the second or third date data. Thanks for your help. If you need a copy of the spreadsheet please let me know. |
Match Function
Glad you got it straightened out! Thanks for the feedback!
-- Biff Microsoft Excel MVP "Melanie" wrote in message ... I have now. And it is now working. Thank you so much for all your help. "Bob Phillips" wrote: Did you array enter it as suggested? -- __________________________________ HTH Bob "Melanie" wrote in message ... I put the formulas in and the count works but the second formula gives me a #Value Error. "T. Valko" wrote: One way... Assume your data is in the range A2:D500 F2:H2 = headers: Code, State, Description F1 = lookup date Enter this formula in G1. This will return the count of dates based on the date entered in cell F1: =COUNTIF(A:A,F1) Enter this array formula** in F3: =IF(ROWS(F$3:F3)<=$G$1,INDEX(B$2:B$500,SMALL(IF($A $2:$A$500=$F$1,ROW(B$2:B$500)),ROWS(F$3:F3))-ROW(B$2)+1),"") ** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER. Copy across to H3 then down to a number of rows that ensures you get all the results. How many rows that is depends on the maximum count for any single date. For example, if 1/1/2009 appears the most times, let's say it appears 5 times, then you need to copy the formula to at least 5 rows. -- Biff Microsoft Excel MVP "Melanie" wrote in message ... Lots - over 300 at the moment and it gets added to all the time. "T. Valko" wrote: How many rows of data do you have? -- Biff Microsoft Excel MVP "Melanie" wrote in message ... Hi, I have put together a spreadsheet to find codes, states, descriptions. It finds the data by dates. Columns a Dates, Codes, States, Descriptions If I put in a date it matches the code, state and description. My problem is that if I have 2 dates that are the same it will only match the first date it can find. What kind of formula do I need so that it will output the second or third date data. Thanks for your help. If you need a copy of the spreadsheet please let me know. |
All times are GMT +1. The time now is 02:41 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com