LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 829
Default Help/Check my Formula

"revpeachy" wrote:
Please could someone kindly check my formula:

[....]
=IF(G4="","",IF(G4<100%,1,IF(G4=100%,2,IF(G4=111 %,3))))


Conditions are tested left-to-right. If G4 is larger than 111%, it is also
larger than 100%, which is tested first. So the formula would return 2
instead of 3 as you intended.

At a minimum, try:

=IF(G4="","",IF(G4<100%,1,IF(G4<111%,2,3)))

More generally, especially if you might have more conditions to test in the
futu

=IF(G4="","",LOOKUP(G4,{0,1,1.11},{1,2,3}))

That assumes G4 is never negative. If it might be, change 0 to -1E300,
almost the smallest negative number that can be represented and that is easy
to remember.

However, in all cases, you might encounter some surprises if G4 is a
calculated. It might display 100% or 111%, but that is rounded from the
actual value, which might be less.

The following is more reliable:

=IF(G4="","",LOOKUP(ROUND(G4,2),{0,1,1.11},{1,2,3} )

Change ROUND(...,2) to ROUND(...,4) if you format G4 as Percentage with 2
decimal places, for example.

 
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
Gap check formula? LSSR Excel Worksheet Functions 7 February 21st 08 01:11 AM
Can someone please check this formula Perico[_2_] Excel Programming 2 January 27th 07 01:41 AM
Can someone check this formula please? y_not Excel Discussion (Misc queries) 4 May 14th 06 07:31 PM
Check box and and formula Russell-stanely Excel Discussion (Misc queries) 7 July 7th 05 09:06 PM
How do I set up a formula with a check box? Russell-stanely Excel Discussion (Misc queries) 2 January 28th 05 07:17 PM


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