Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 8
Default If Function neglecting 0 as a number

I have this function:

=IF(B1="","",LOOKUP(COLUMNS($A$1:B1)-COUNTIF($A1:B1,"="),{1,2,3,4},{0.2,0.19,0.18,0.17} ))

I'm wanting to modify it in such a way that when I put 0(zero) on A1, the result on B2 would still be 0.2 instead of .19. For some reason, every time I put 0 on A1, the function is recognizing it as a number.

I attached the excel screen shot.

Thanks.
Attached Images
 
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 829
Default If Function neglecting 0 as a number

"managingcrap" wrote:
I have this function:
=IF(B1="","",LOOKUP(COLUMNS($A$1:B1)-COUNTIF($A1:B1,"="),{1,2,3,4},{0.2,0.19,0.18,0.17} ))
I'm wanting to modify it in such a way that when I put 0(zero) on A1,
the result on B2 would still be 0.2 instead of .19. For some reason,
every time I put 0 on A1, the function is recognizing it as a number.


I believe COLUMNS($A$1:B1)-COUNTIF($A1:B1,"=") is the same as
COUNTIF($A1:B1,"<"), when dragged across a column.

(The expression does not make sense if you dragged it across and down a
rectangular range.)

Try:
=IF(B1="","",LOOKUP(COUNTIF($A1:B1,"<")-COUNTIF($A1:B1,0),{0,2,3,4},{0.2,0.19,0.18,0.17}))

Note the change from {1,2,3,4} to {0,2,3,4}. Thus, 0.2 is returned when the
first expression is 0 or 1.


"managingcrap" wrote:
I attached the excel screen shot.

[....]
|Download: http://www.excelbanter.com/attachment.php?attachmentid=929|


For future reference, an actual Excel file is better than an image.
Otherwise, we must take it on faith that you replicated the formula
correctly in A3 and C3:H3.

Reply
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
function - find first number in row 0, return cell column number cate Excel Programming 3 April 19th 11 09:44 PM
R: function - find first number in row 0, return cell column number r[_4_] Excel Programming 0 April 19th 11 09:44 PM
How to add cells yet neglecting alphabet dats perfection Excel Discussion (Misc queries) 3 April 11th 08 09:47 PM
return cardinal number from ordinal number function - an example [email protected] Excel Programming 2 August 15th 05 07:17 PM
Using the autofill function but increment by certain number in function rishid Excel Worksheet Functions 1 July 14th 05 07:40 PM


All times are GMT +1. The time now is 09:34 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"