View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Smallweed Smallweed is offline
external usenet poster
 
Posts: 133
Default Creating Complex Functions in the Worksheet Formula Bar - THIS IS

Interesting way round to come at Excel but it happens...

Inside out really. Here's an example of a nested If function (tends to
shock and amaze programmers!). Stick it in C2 and experiment with colours (a
really useful tool is Tools, Formula Auditing, Evaluate Formula):

=IF(AND(A2="Red",B2="Yellow"),"Orange",IF(OR(A2="S carlet",B2="Crimson"),"Red",IF(AND(OR(A2="Blue",A2 ="Navy"),B2="Yellow"),"Green","Some other colour")))

The Ands and Ors are read outwards before the Ifs are evaluated [syntax of IF:
IF(condition, if true, if false)]

Hope that helps in some way!

"SteveM" wrote:

This may seem strange, but I code in VBA but never created complex
functions on a worksheet itself. Now it's driving me crazy trying to
embed functions in functions.

Is there some sort of trick there? Outside in? Inside out?

Or some kind of editing tool?

Thanks.

SteveM