LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,651
Default writting an IF command that will skip cells

On Fri, 2 May 2008 23:49:01 -0700, prem wrote:

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


If your serial numbers are randomly entered (or entered with occasional skips
in the sequence), then this array formula, entered into some cell and filled
down until it produces an error, should return the adjacent dates.

SerialNums and Dts are named ranges, but you can substitute any single column
range reference or NAME.

To enter an array formula, hold down <ctrl<shift while hitting <enter. Excel
will place braces {...} around the formula:

=INDEX(Dts,SMALL((MOD(SerialNums,8)=0)*ROW(SerialN ums),
ROWS($1:1)+SUMPRODUCT(--(MOD(SerialNums,8)<0))))

--ron
 
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
skip cells with zero values in chart (cells not empty) jhall@ifox Charts and Charting in Excel 3 June 2nd 09 02:11 PM
How do I get an average for 5 when I need to skip cells? Troy H Excel Discussion (Misc queries) 7 February 5th 06 02:21 PM
How do I skip over null cells? Excel Dummy Excel Discussion (Misc queries) 4 January 3rd 06 01:13 PM
How do I skip blank cells when copying over a range of cells? tawells Excel Discussion (Misc queries) 2 June 7th 05 09:36 PM
how to skip the blank cells nayeemoddin Excel Discussion (Misc queries) 1 December 6th 04 07:07 AM


All times are GMT +1. The time now is 10:03 PM.

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

About Us

"It's about Microsoft Excel"