ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to set a cell value based on "OR" function? (https://www.excelbanter.com/excel-discussion-misc-queries/136110-how-set-cell-value-based-function.html)

Ronnie

How to set a cell value based on "OR" function?
 
I need to caluclate the value of C1 depending on sexe (M or F)
A1 = M or F
B1 = 40
If A1=M then C1=B1+10, Or IF A1=F then C1=B1+5
How do i get this in one formula?
Each seperate formula for M and F works fine, however when combining both
the system returns TRUE in C1 i.s.o. a calucalated value
Thanks in advance,
Ron

Dave F

How to set a cell value based on "OR" function?
 
=IF(A1="M",B1+10,B1+5)

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"Ronnie" wrote:

I need to caluclate the value of C1 depending on sexe (M or F)
A1 = M or F
B1 = 40
If A1=M then C1=B1+10, Or IF A1=F then C1=B1+5
How do i get this in one formula?
Each seperate formula for M and F works fine, however when combining both
the system returns TRUE in C1 i.s.o. a calucalated value
Thanks in advance,
Ron


Niek Otten

How to set a cell value based on "OR" function?
 
Hi Ron,

=IF(A1="M",B1+10,B1+15)

or, to check for something not F or M:

=IF(A1="m",B1+10,IF(A1="F",B1+15,"ERROR"))

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Ronnie" wrote in message ...
|I need to caluclate the value of C1 depending on sexe (M or F)
| A1 = M or F
| B1 = 40
| If A1=M then C1=B1+10, Or IF A1=F then C1=B1+5
| How do i get this in one formula?
| Each seperate formula for M and F works fine, however when combining both
| the system returns TRUE in C1 i.s.o. a calucalated value
| Thanks in advance,
| Ron



Niek Otten

How to set a cell value based on "OR" function?
 
Of course the 15 should have been 5 in both cases

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Niek Otten" wrote in message ...
| Hi Ron,
|
| =IF(A1="M",B1+10,B1+15)
|
| or, to check for something not F or M:
|
| =IF(A1="m",B1+10,IF(A1="F",B1+15,"ERROR"))
|
| --
| Kind regards,
|
| Niek Otten
| Microsoft MVP - Excel
|
| "Ronnie" wrote in message ...
||I need to caluclate the value of C1 depending on sexe (M or F)
|| A1 = M or F
|| B1 = 40
|| If A1=M then C1=B1+10, Or IF A1=F then C1=B1+5
|| How do i get this in one formula?
|| Each seperate formula for M and F works fine, however when combining both
|| the system returns TRUE in C1 i.s.o. a calucalated value
|| Thanks in advance,
|| Ron
|
|




All times are GMT +1. The time now is 09:17 AM.

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