ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   More elegant way to do IF () (https://www.excelbanter.com/excel-worksheet-functions/86878-more-elegant-way-do-if.html)

Barb Reinhardt

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

Niek Otten

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



CLR

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


Barb Reinhardt

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




Niek Otten

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
|
|
|



Ron Coderre

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


Niek Otten

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
|
|
|



Aladin Akyurek

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



All times are GMT +1. The time now is 09:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com