View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Roger Govier[_3_] Roger Govier[_3_] is offline
external usenet poster
 
Posts: 2,480
Default writting an IF command that will skip cells

Hi

On the second sheet, change your formula to
=IF(MOD(A2,8)=0,B2,"")
This will leave Nulls on the rows where there is no match.
Copy down for as many rows as you have data in column A of sheet 1.
When finished, Sort Sheet2 Column A and all the blank rows will be moved to
the end of the list and your results will be bunched at the top.
--
Regards
Roger Govier

"prem" wrote in message
...
Hi guys this is my problem.

I have serial numbers in my entire A column and dates in my entire B
column.

On a separate workskeet, I want to create a command that will check if the
serial number is a multiple of 8. If it is, I want it to return the date
the
the corresponding B column/row. I came up with =IF(MOD(A2,8)=0,B2,"NA").

However, I do not want "NA" returned when the A column value is not a
multiple of 8. Instead I want it to check the value in the next A row, and
if
that is not a multiple of 8, to keep going till it reaches a row where the
value the data in cell A is indeed a multiple of 8 and return the date
from
the coresponding B column/row.

How might I achieve this? Thank you in advance.

Prem