Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Workaround for IF Worksheet Function 1

Status
Not open for further replies.

thunderkid

Technical User
Oct 26, 2000
54
US
I am running into limitations with IF worksheet function--allows seven nested IF statement. I have budget worksheet and I want the balance to be read based on month of year. Here is an example:
B2 =IF(A4="JAN",E1,IF(A4="FEB",E2,IF(A4="MAR",E3,IF(A4="apr",E4,IF(A4="MAY",E5,IF(A4="JUN",E6,IF(A4="JUL",E7)))))))

A4 = JAN

E1 = 124
E2 = 125
E3 = 126
E4 = 127
E5 = 128
E6 = 129
E7 = 130

Using the IF worksheet function as described above I have to have redo formula in B2 in July to read the rest of the months.

Does anyone know another way to build formula (within one cell) that will allow me to read the balance from all 12 months?

Thanks
 
jdhilljr,
Your solution was right onthe mark. Thanks. have a star!
thunderkid
 
Other Options

=INDEX(E1:E12,A4)

=OFFSET(E1,A4-1,0)

Regards
Ken...............

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]

----------------------------------------------------------------------------
 
And if you really wanted to keep the text month eg Jan, Feb etc then

=INDEX(E1:E12,MATCH(A4,{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"},0))

Regards
Ken.............

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]

----------------------------------------------------------------------------
 
Or even:

=(A4="JAN")*E1+(A4="FEB")*E2+(A4="MAR")*E3+(A4="APR")*E4+(A4="MAY")*E5+(A4="JUN")*E6+(A4="JUL")*E7+(A4="AUG")*E8+(A4="SEP")*E9+(A4="OCT")*E10+(A4="NOV")*E11+(A4="DEC")*E12

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top