Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 07-03-2009, 10:20 AM
eddy1234 eddy1234 is offline
Registered User
 
Join Date: 28 Mar 2009
Location: somewhere
MS Office Version:Excel 2000
Posts: 2
eddy1234 is becoming part of the community
tables and if function

Please Register to Remove these Ads

a value | b value |marks section Value
x< 4.5 10 | x< 4.5 40 | 2.4 a 10
x> 4.5 20 | x> 4.5 60 | 4.9 a 20
---------------- |----------------| 5.5 b 60

Here's my problem, i've got 3 tables, the first two is for reference, and the third is what i am after.

The third table consists of 2 variables; marks and section, the corresponding "Value" depends on either table a or b AND the range in which the marks falls into. e.g. for the first row of the third table, refer to table a and 2.4<4.5 so the return value is 10.

My solution was to make a function on the first row of the third table:

=if(F2="a",if(E2<4.5,10,20),if(E2<4.5,40,60))

*note F2 and E2 refers to the column and row of the variables "section" and "marks"

This works fine for me but what if there are a lot of tables? say a to z? AND a range of values, say x<10,10<x<100,x>100..

I could use nested IF repeatedly but i think its too complicated and tedious to write. Is there any other way to get around this problem?

Last edited by eddy1234; 07-03-2009 at 10:24 AM.
Reply With Quote
  #2  
Old 07-03-2009, 03:21 PM
zbor's Avatar
zbor zbor is online now
Valued Forum Contributor
 
Join Date: 10 Feb 2009
Location: Croatia
MS Office Version:Excel 2007
Posts: 2,519
zbor is very confident of their ability zbor is very confident of their ability zbor is very confident of their ability zbor is very confident of their ability zbor is very confident of their ability
Send a message via MSN to zbor
Re: tables and if function

Then you need not to refer to numbers but to cells (where you can change numbers)

For example: instead of =if(F2="a",if(E2<4.5,10,20),if(E2<4.5,40,60))

Define some cells eg A1=4.5, A2=10, A3=20, A4=40, C50=60 and write:

=if(F2="a",if(E2<$A$1,$A$2,$A$3),if(E2<$A$1,$A$4,$C$50))
__________________
"Relax. What is mind? No matter. What is matter? Never mind!"
Reply With Quote
  #3  
Old 07-03-2009, 08:01 PM
eddy1234 eddy1234 is offline
Registered User
 
Join Date: 28 Mar 2009
Location: somewhere
MS Office Version:Excel 2000
Posts: 2
eddy1234 is becoming part of the community
Re: tables and if function

Hi Zbor,

Yes that would be convenient if the data in the table keeps changing but what about additional table? If i had 13 more tables, that would take me a long time to write the IF function plus it would be difficult to check the codes.

Im thinking of changing the position of cell with respect to the table referred.
Say if table=a, then E2 value will be compared with cell $A$2
if table=b, then E2 value will be compared with cell $f$2
if table=c, then E2 value will be compared with cell $J$2

Any suggestions on how to do it?

* note that E2 from previous post:the first row of the third table. F2 and J2 are data from table a,b,c.
Reply With Quote
  #4  
Old 07-04-2009, 02:54 AM
zbor's Avatar
zbor zbor is online now
Valued Forum Contributor
 
Join Date: 10 Feb 2009
Location: Croatia
MS Office Version:Excel 2007
Posts: 2,519
zbor is very confident of their ability zbor is very confident of their ability zbor is very confident of their ability zbor is very confident of their ability zbor is very confident of their ability
Send a message via MSN to zbor
Re: tables and if function

Can you upload some example?
__________________
"Relax. What is mind? No matter. What is matter? Never mind!"
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump