Excel IF statement

Eunique11

New member
Local time
Today, 01:49
Joined
Aug 5, 2010
Messages
7
I need an if then statement that does the following:

So far this is what I have come up with:
=if(c2="jan",b2/12,0)

If the statement is true how do I get it to go feb-dec. If it is not true how do I get it to jump to feb and continously do the same thing until it gets to dec?
 
Last edited:
How's this:

Code:
If you're expecting us to do your homework for you then exit sub.
 
The code is not for an assignment. My assignment is done. I manually did the work, i just thought it would be cool to do it automatically. Thanks for the code!
 
You say that you edited the first post because of confusion, I suspect that it was to remove the statement that led to Chergh's post. The first post is now totally unclear as to what you are attempting to do with what, however what is there makes me suspect that you can only do what is required using VBA. If your course has covered that then attempt it and comeback with specifics, if not it would be foolish for us to just write it out for you.

Brian
 
I am currently not in any courses as school has not started yet. However my degree required me to take a basic MS Office course which I passed with flying colors. My degree is in business and I did a budget for an internship. That was done easily but now that I am done I thought wouldnt it be cool to have a different spreadsheet that if I added future employees it would automatically update the budget within the month they were hired. So that is why I posted the way I did originally. I edited because I did not want anyone to get the impression that it was for a class.
 
You say that you edited the first post because of confusion, I suspect that it was to remove the statement that led to Chergh's post.

Well the first post said something along the lines off "I need to do this for a school assignment" so there wasn't much to be confused about.
 
I understand that. I have never posted anything on any website, blog, or etc. I just wanted some help.

I have tried everything that I can think of

=if(c2="jan"b2/12,0)....(c2="dec"b2/12,0)

Obviously that didn't work. I can sit here and be ridiculed about my choice of words in a blog or I can receive an answer to feed my curiosity. If you like I can place my school calendar on here to reassure everyone that class is currently not in session and even the curriculum for an mba program which requires nothing over a basic level of excel.
 
Ok well to answer your current post 1 I assume that B2 contains the years budget and c2 to n2 contain the months of the year therefore in each col put =IF($B2<>"",$B2/12,"")

Brian
 
Well the first post said something along the lines off "I need to do this for a school assignment" so there wasn't much to be confused about.

Yup that seems pretty clear to me, but atleast honest.

Brian
 
Brian- Close. However, Lets say if I am adding a new employee and I they will not start until May. How do I get it to divide what I want to pay the employee by 12 place that number in the may-dec columns and place a 0 in the jan-apr columns.

So in b2 is the salary
c2 is the hire month
 
The only way to achieve that is with VBA, in my opinion, and I suspect that you have not learnt that.

Brian
 
That would be correct. I have not learnt that. Excel amazes me, I just do not know how to work it to the "wow" factor.
 
Actually if you had the Month Number in C2 and the Month Number as your column heading the you could code say in f2

If(c2>f1,0,b2/12) thus if a guy starts after March we have a 0, else we have a Salary.

Brian
 
Brian that worked perfectly! Now I am curious on the VBA's you were talking about, I have to go research that. I think on my own time I am going to take an intermediate course in excel so i can stand out amongst my peers because we receive no training in this whatsoever.

Thank you again!
 
If you read some of the threads you will see how frequently VBA is used to resolve issues, whether you will require it will depend on what you do, but ACCESS and Excel require it to do sophisticated things, infact ACCESS just requires it, end of.

Best of luck in your career

Brian
 
I was not completely satisfied with my earlier response that you needed to have numeric months, and, this must be an age thing :D, it was while watching Question of Sport on the box the answer, Vlookup, popped out.
Anyway here it is for anybody interested,

Make a table on another worksheet of text and numeric months say in a1:b12, and call it monthconv, then you can use the following

Code:
=IF(VLOOKUP($C$2,monthconv,2,FALSE)>VLOOKUP(D$1,monthconv,2,FALSE),0,$B$2/12)

C2 will contain say May and row 1 will contain the text months.

I think I'm getting out of touch and a bit slow.

Brian
 

Users who are viewing this thread

Back
Top Bottom