ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Create formula (https://www.excelbanter.com/excel-worksheet-functions/111282-create-formula.html)

EOB

Create formula
 
How do I create this Formula in cell If K6=4 then E6=1 and IF K6=3 then
E6=2 and IF K6=2 then E6=2 and IF K6=1 then E6=4?


Ron Coderre

Create formula
 
If K6 can only contain 1,2,3 or 4, then maybe this?

E6: =5-K6

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"EOB" wrote:

How do I create this Formula in cell If K6=4 then E6=1 and IF K6=3 then
E6=2 and IF K6=2 then E6=2 and IF K6=1 then E6=4?


Ron Rosenfeld

Create formula
 
On Fri, 22 Sep 2006 18:41:02 -0700, EOB wrote:

How do I create this Formula in cell If K6=4 then E6=1 and IF K6=3 then
E6=2 and IF K6=2 then E6=2 and IF K6=1 then E6=4?


There are many ways.

Here's one:

E6: =IF(ISERR(CHOOSE(K6,4,2,2,1)),"K6 out of range",CHOOSE(K6,4,2,2,1))


Here's another:

E6: =IF(K6=4,1,IF(OR(K6={3,2}),2,IF(K6=1,4,"K6 out of range")))



--ron

Ron Rosenfeld

Create formula
 
On Fri, 22 Sep 2006 18:48:01 -0700, Ron Coderre
wrote:

If K6 can only contain 1,2,3 or 4, then maybe this?

E6: =5-K6

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"EOB" wrote:

How do I create this Formula in cell If K6=4 then E6=1 and IF K6=3 then
E6=2 and IF K6=2 then E6=2 and IF K6=1 then E6=4?


But E6 = 2 when K6 = 2 or 3


--ron

Dana DeLouis

Create formula
 
Here's one idea as an array formula:

=IF(OR(K6={1,2,3,4}),MOD(226, K6 + 5),#N/A)

--
HTH :)
Dana DeLouis
Windows XP & Office 2003


"EOB" wrote in message
...
How do I create this Formula in cell If K6=4 then E6=1 and IF K6=3 then
E6=2 and IF K6=2 then E6=2 and IF K6=1 then E6=4?




Leo Heuser

Create formula
 
"EOB" skrev i en meddelelse
...
How do I create this Formula in cell If K6=4 then E6=1 and IF K6=3 then
E6=2 and IF K6=2 then E6=2 and IF K6=1 then E6=4?


Another option:

In E6:

=INDEX({4,2,2,1},MATCH(K6,{1,2,3,4},0))


--
Best regards
Leo Heuser

Followup to newsgroup only please.




All times are GMT +1. The time now is 12:13 PM.

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