Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
IF - how to avoid cells with no value
Hello,
I have a monthly report I have to process. There are two values in column F, either 5 or 10. If the value of the cell in column F is 5 I want the information in column A to be displayed, lets say in column J, and if 10 in column K. I have used the following formula IF(F2=5,A2,"") which shows me the information I want in column J. The problem is that I end up with many cells with no information in columns J and I would like the cells with values from column A to be displayed after each other without empty cells in between. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
IF - how to avoid cells with no value
In column J, you want to display the value in column A if column F is 5 and 10 in column K and that you have your formula in both J and K if there is no 5 or 10 in F, the formula will return a blank as in your formula Therefore, not sure what you want to achieve here, would you post a sample and the result you want? -- Hope this is helpful Pls click the Yes button below if this post provide answer you have asked Thank You cheers, francis "Heidi" wrote: Hello, I have a monthly report I have to process. There are two values in column F, either 5 or 10. If the value of the cell in column F is 5 I want the information in column A to be displayed, lets say in column J, and if 10 in column K. I have used the following formula IF(F2=5,A2,"") which shows me the information I want in column J. The problem is that I end up with many cells with no information in columns J and I would like the cells with values from column A to be displayed after each other without empty cells in between. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
IF - how to avoid cells with no value
On 3/7/09 10:14 AM, Heidi wrote:
Hello, I have a monthly report I have to process. There are two values in column F, either 5 or 10. If the value of the cell in column F is 5 I want the information in column A to be displayed, lets say in column J, and if 10 in column K. I have used the following formula IF(F2=5,A2,"") which shows me the information I want in column J. The problem is that I end up with many cells with no information in columns J and I would like the cells with values from column A to be displayed after each other without empty cells in between. Heidi, It's not exactly clear by your last statement what you intend for your end result. Could you post an example ? -- Art |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
IF - how to avoid cells with no value
Hi,
Try the following array formula: =IF(ROW(A1)<=COUNTIF(F$2:F$9,5),INDEX(A$2:A$9,SMAL L(IF(F$2:F$9=5,ROW(F$2:F$9),""),ROW(A1))),"") To make it an array enter it by pressing Shift+Ctrl+Enter. -- If this helps, please click the Yes button. Cheers, Shane Devenshire "Heidi" wrote: Hello, I have a monthly report I have to process. There are two values in column F, either 5 or 10. If the value of the cell in column F is 5 I want the information in column A to be displayed, lets say in column J, and if 10 in column K. I have used the following formula IF(F2=5,A2,"") which shows me the information I want in column J. The problem is that I end up with many cells with no information in columns J and I would like the cells with values from column A to be displayed after each other without empty cells in between. |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
IF - how to avoid cells with no value
Heidi
To get the values into a contiguous range would require VBA as far as I can tell from your description. Or you could autofilter each column J and K in turn for non-blanks then copy to another range. Gord Dibben MS Excel MVP On Sat, 7 Mar 2009 07:14:02 -0800, Heidi wrote: Hello, I have a monthly report I have to process. There are two values in column F, either 5 or 10. If the value of the cell in column F is 5 I want the information in column A to be displayed, lets say in column J, and if 10 in column K. I have used the following formula IF(F2=5,A2,"") which shows me the information I want in column J. The problem is that I end up with many cells with no information in columns J and I would like the cells with values from column A to be displayed after each other without empty cells in between. |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
IF - how to avoid cells with no value
=IF(ROW(A1)<=COUNTIF(F$2:F$9,5),INDEX(A$2:A$9,SMA LL(IF(F$2:F$9=5,ROW(F$2:F$9),""),ROW(A1))),"")
That formula will miss the first instance that meets the criteria. Here's the robust version. Let's assume they want the data starting in cell J2. Array entered: =IF(ROWS(J$2:J2)<=COUNTIF(F$2:F$9,5),INDEX(A$2:A$9 ,SMALL(IF(F$2:F$9=5,ROW(F$2:F$9)),ROWS(J$2:J2))-MIN(ROW(F$2:F$9))+1),"") -- Biff Microsoft Excel MVP "Shane Devenshire" wrote in message ... Hi, Try the following array formula: =IF(ROW(A1)<=COUNTIF(F$2:F$9,5),INDEX(A$2:A$9,SMAL L(IF(F$2:F$9=5,ROW(F$2:F$9),""),ROW(A1))),"") To make it an array enter it by pressing Shift+Ctrl+Enter. -- If this helps, please click the Yes button. Cheers, Shane Devenshire "Heidi" wrote: Hello, I have a monthly report I have to process. There are two values in column F, either 5 or 10. If the value of the cell in column F is 5 I want the information in column A to be displayed, lets say in column J, and if 10 in column K. I have used the following formula IF(F2=5,A2,"") which shows me the information I want in column J. The problem is that I end up with many cells with no information in columns J and I would like the cells with values from column A to be displayed after each other without empty cells in between. |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
IF - how to avoid cells with no value
Hi,
Glad someone is checking. Anyway with the current example, I think just a minor modifcation is necessary, add the -1. =IF(ROW(A1)<=COUNTIF(F$2:F$9,5),INDEX(A$2:A$9,SMAL L(IF(F$2:F$9=5,ROW(F$2:F$9)-1,""),ROW(A1))),"") Array entered again. -- If this helps, please click the Yes button. Cheers, Shane Devenshire "T. Valko" wrote: =IF(ROW(A1)<=COUNTIF(F$2:F$9,5),INDEX(A$2:A$9,SMA LL(IF(F$2:F$9=5,ROW(F$2:F$9),""),ROW(A1))),"") That formula will miss the first instance that meets the criteria. Here's the robust version. Let's assume they want the data starting in cell J2. Array entered: =IF(ROWS(J$2:J2)<=COUNTIF(F$2:F$9,5),INDEX(A$2:A$9 ,SMALL(IF(F$2:F$9=5,ROW(F$2:F$9)),ROWS(J$2:J2))-MIN(ROW(F$2:F$9))+1),"") -- Biff Microsoft Excel MVP "Shane Devenshire" wrote in message ... Hi, Try the following array formula: =IF(ROW(A1)<=COUNTIF(F$2:F$9,5),INDEX(A$2:A$9,SMAL L(IF(F$2:F$9=5,ROW(F$2:F$9),""),ROW(A1))),"") To make it an array enter it by pressing Shift+Ctrl+Enter. -- If this helps, please click the Yes button. Cheers, Shane Devenshire "Heidi" wrote: Hello, I have a monthly report I have to process. There are two values in column F, either 5 or 10. If the value of the cell in column F is 5 I want the information in column A to be displayed, lets say in column J, and if 10 in column K. I have used the following formula IF(F2=5,A2,"") which shows me the information I want in column J. The problem is that I end up with many cells with no information in columns J and I would like the cells with values from column A to be displayed after each other without empty cells in between. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Make unique cells - Avoid repeating Values | Excel Discussion (Misc queries) | |||
how can avoid considering of blank cells in IF function | Excel Worksheet Functions | |||
Can I avoid plotting 'non-empty' cells | Charts and Charting in Excel | |||
Excel truncated my cells when copying, how to avoid?? | Excel Discussion (Misc queries) | |||
Need formula to avoid ":" in cells with tt:mm | Excel Worksheet Functions |