Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Barb Reinhardt
 
Posts: n/a
Default More elegant way to do IF ()

My formula currently looks like this

=if(or(A=Green,A=Yellow,A=Red),1,0)

unfortunately A is a fairly long formula. Is there a more elegant way to do
this?

Thanks,
Barb Reinhardt
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Niek Otten
 
Posts: n/a
Default More elegant way to do IF ()

Hi Barb,

I don't know the restrictions you might have, but if possible I would always store the A formula in a cell and use that address to
compare.

--
Kind regards,

Niek Otten

"Barb Reinhardt" wrote in message
...
| My formula currently looks like this
|
| =if(or(A=Green,A=Yellow,A=Red),1,0)
|
| unfortunately A is a fairly long formula. Is there a more elegant way to do
| this?
|
| Thanks,
| Barb Reinhardt


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR
 
Posts: n/a
Default More elegant way to do IF ()

Hi Barb..........
Maybe just put the long formula in a helper cell and refer to that cell in
your IF statement..........

hth
Vaya con Dios,
Chuck, CABGx3



"Barb Reinhardt" wrote:

My formula currently looks like this

=if(or(A=Green,A=Yellow,A=Red),1,0)

unfortunately A is a fairly long formula. Is there a more elegant way to do
this?

Thanks,
Barb Reinhardt

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Barb Reinhardt
 
Posts: n/a
Default More elegant way to do IF ()

I thought about that, but would prefer not to as I already have a lot in this
worksheet.

Thanks for your help.

"Niek Otten" wrote:

Hi Barb,

I don't know the restrictions you might have, but if possible I would always store the A formula in a cell and use that address to
compare.

--
Kind regards,

Niek Otten

"Barb Reinhardt" wrote in message
...
| My formula currently looks like this
|
| =if(or(A=Green,A=Yellow,A=Red),1,0)
|
| unfortunately A is a fairly long formula. Is there a more elegant way to do
| this?
|
| Thanks,
| Barb Reinhardt



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Niek Otten
 
Posts: n/a
Default More elegant way to do IF ()

Hi Barb,

Consider a defined name for your formula.


--
Kind regards,

Niek Otten

"Barb Reinhardt" wrote in message
...
|I thought about that, but would prefer not to as I already have a lot in this
| worksheet.
|
| Thanks for your help.
|
| "Niek Otten" wrote:
|
| Hi Barb,
|
| I don't know the restrictions you might have, but if possible I would always store the A formula in a cell and use that
address to
| compare.
|
| --
| Kind regards,
|
| Niek Otten
|
| "Barb Reinhardt" wrote in message
| ...
| | My formula currently looks like this
| |
| | =if(or(A=Green,A=Yellow,A=Red),1,0)
| |
| | unfortunately A is a fairly long formula. Is there a more elegant way to do
| | this?
| |
| | Thanks,
| | Barb Reinhardt
|
|
|




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default More elegant way to do IF ()

Try something like this:

Define this Named Range:
Name: LU_TrafficLights
Refers to: ={"Green","Yellow","Red"}

Now, for a value in A1
B1: =IF(OR(A1=LU_TrafficLights),1,0)

Is that something you can work with?

***********
Regards,
Ron

XL2002, WinXP-Pro


"Barb Reinhardt" wrote:

My formula currently looks like this

=if(or(A=Green,A=Yellow,A=Red),1,0)

unfortunately A is a fairly long formula. Is there a more elegant way to do
this?

Thanks,
Barb Reinhardt

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Niek Otten
 
Posts: n/a
Default More elegant way to do IF ()

You could create a separate worksheet for this, and give the one cell you need a defined name.
It's very likely that you can't even notice the difference in performance and memory usage, and it makes it easier to keep control
of your total workbook.

--
Kind regards,

Niek Otten

"Barb Reinhardt" wrote in message
...
|I thought about that, but would prefer not to as I already have a lot in this
| worksheet.
|
| Thanks for your help.
|
| "Niek Otten" wrote:
|
| Hi Barb,
|
| I don't know the restrictions you might have, but if possible I would always store the A formula in a cell and use that
address to
| compare.
|
| --
| Kind regards,
|
| Niek Otten
|
| "Barb Reinhardt" wrote in message
| ...
| | My formula currently looks like this
| |
| | =if(or(A=Green,A=Yellow,A=Red),1,0)
| |
| | unfortunately A is a fairly long formula. Is there a more elegant way to do
| | this?
| |
| | Thanks,
| | Barb Reinhardt
|
|
|


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Aladin Akyurek
 
Posts: n/a
Default More elegant way to do IF ()

=ISNUMBER(MATCH(A,{"Green","Yellow","Red"},0))+0

Barb Reinhardt wrote:
My formula currently looks like this

=if(or(A=Green,A=Yellow,A=Red),1,0)

unfortunately A is a fairly long formula. Is there a more elegant way to do
this?

Thanks,
Barb Reinhardt

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
Working Hours (formula & graph) - any elegant solution? markx Excel Worksheet Functions 1 March 29th 06 02:02 PM
More elegant method? Biff Excel Worksheet Functions 0 January 13th 06 08:23 AM


All times are GMT +1. The time now is 11:43 AM.

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

About Us

"It's about Microsoft Excel"