ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   IF formula - odd/even months and different names (https://www.excelbanter.com/excel-discussion-misc-queries/188929-if-formula-odd-even-months-different-names.html)

agatha

IF formula - odd/even months and different names
 
Hi, I need to write a formula that shows different names for different
months. Like, in column A I will have months of the year and column B I will
have a scientist name. For €œodd€ months (Jan, Mar, May, Jul, Sep, Nov), I
want scientist A, for €œeven€ months (Feb, Apr, Jun, Aug, Oct, Dec)I want
scientist B. I usually use IF formula, but I am lost on this one. How do I do
that? Thanks a lot!

John Bundy

IF formula - odd/even months and different names
 
Try this one out
=IF(MOD(MONTH(1&A1),2)=0,"Scientist B","Scientist A")
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"agatha" wrote:

Hi, I need to write a formula that shows different names for different
months. Like, in column A I will have months of the year and column B I will
have a scientist name. For €œodd€ months (Jan, Mar, May, Jul, Sep, Nov), I
want scientist A, for €œeven€ months (Feb, Apr, Jun, Aug, Oct, Dec)I want
scientist B. I usually use IF formula, but I am lost on this one. How do I do
that? Thanks a lot!


joel

IF formula - odd/even months and different names
 
You need to create a date value like 1 Jan 2008 to get the month number.
Then use the MOD function to get the even and odd months. there are a few
other methods that can accomplish the same results.

=IF(MOD(MONTH(DATEVALUE("1 "&A7&" "&YEAR(TODAY()))),2)=1,"Scientist
A","Scientist B")
"agatha" wrote:

Hi, I need to write a formula that shows different names for different
months. Like, in column A I will have months of the year and column B I will
have a scientist name. For €œodd€ months (Jan, Mar, May, Jul, Sep, Nov), I
want scientist A, for €œeven€ months (Feb, Apr, Jun, Aug, Oct, Dec)I want
scientist B. I usually use IF formula, but I am lost on this one. How do I do
that? Thanks a lot!



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

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