Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 3
Default Multiple IF statements or a better method ?

I am new to this forum and a novice with Excel especially with respect to creating fomulas.

Help !!

I have created a VLOOKUP table that has a value grid of 7 rows x 5 columns (apartment codes x different rates depending on length of stay). Therefore depending on the apartment code the guest wants and their length of stay there are 35 possible results.

Using this forum, I managed (somehow) to put together a few concatenated IF statements to point to the correct cell in the VLOOKUP table depending on apartment code and length of stay. I now realise that I will have to do 35 concatenated IF statements and my head is beginning to explode just doing two !

Is there a better way ? I know thereis a limitof 7nested IF statements but is there a limit to thenumber of concatenated IF statements (if that is a different thing) ?

Some examples of my bodged (but working) code is :-

=IF((AND(B310,B31<8,F21="KOC05")),VLOOKUP(F21,Pri ces!A3:C10,3,FALSE),IF((AND(B310,B31<8,F21="KOC03 ")),VLOOKUP(F21,Prices!A3:C10,3,FALSE),"Invali d Input"))

p.s1
length of stays are daily, weekly, monthly, 3 monthly and 6 monthly.
ps2
administrator will just input apartment code and length of stay to automatliccly pass rate to an invoice.
  #2   Report Post  
Junior Member
 
Posts: 3
Default

Quote:
Originally Posted by Bob Moore
I am new to this forum and a novice with Excel especially with respect to creating fomulas.

Help !!

I have created a VLOOKUP table that has a value grid of 7 rows x 5 columns (apartment codes x different rates depending on length of stay). Therefore depending on the apartment code the guest wants and their length of stay there are 35 possible results.

Using this forum, I managed (somehow) to put together a few concatenated IF statements to point to the correct cell in the VLOOKUP table depending on apartment code and length of stay. I now realise that I will have to do 35 concatenated IF statements and my head is beginning to explode just doing two !

Is there a better way ? I know thereis a limitof 7nested IF statements but is there a limit to thenumber of concatenated IF statements (if that is a different thing) ?

Some examples of my bodged (but working) code is :-

=IF((AND(B310,B318,F21="KOC05")),VLOOKUP(F21,Price s!A3:C10,3,FALSE),IF((AND(B310,B318,F21="KOC03")), VLOOKUP(F21,Prices!A3:C10,3,FALSE),"Invalid Input"))

p.s1
length of stays are daily, weekly, monthly, 3 monthly and 6 monthly.
ps2
administrator will just input apartment code and length of stay to automatliccly pass rate to an invoice.
Please ignore my code sample os the copy and paste somehow got all screwed up.
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 174
Default Multiple IF statements or a better method ?

I can't quite work out your cell references but this sounds an ideal
candidate for an INDEX/MATCH formula.

If you have your 5 possible lengths of stay in B1:F1, your seven apartment
codes in A2:A8 then your 35 prices will be in B2:F8 so use this formula

=INDEX(B2:F8,MATCH(J2,A2:A8,0),MATCH(K2,B1:F1,0))

where J2 contains your specific apartment code and K2 specific length of stay

"Bob Moore" wrote:


I am new to this forum and a novice with Excel especially with respect
to creating fomulas.

Help !!

I have created a VLOOKUP table that has a value grid of 7 rows x 5
columns (apartment codes x different rates depending on length of
stay). Therefore depending on the apartment code the guest wants and
their length of stay there are 35 possible results.

Using this forum, I managed (somehow) to put together a few
concatenated IF statements to point to the correct cell in the VLOOKUP
table depending on apartment code and length of stay. I now realise
that I will have to do 35 concatenated IF statements and my head is
beginning to explode just doing two !

Is there a better way ? I know thereis a limitof 7nested IF statements
but is there a limit to thenumber of concatenated IF statements (if
that is a different thing) ?

Some examples of my bodged (but working) code is :-

=IF((AND(B310,B31<8,F21="KOC05")),VLOOKUP(F21,Pri ces!A3:C10,3,FALSE),IF((AND(B310,B31<8,F21="KOC03 ")),VLOOKUP(F21,Prices!A3:C10,3,FALSE),"Invali d
Input"))

p.s1
length of stays are daily, weekly, monthly, 3 monthly and 6 monthly.
ps2
administrator will just input apartment code and length of stay to
automatliccly pass rate to an invoice.




--
Bob Moore

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Multiple IF statements or a better method ?

On Fri, 24 Nov 2006 21:06:47 +0000, Bob Moore
wrote:


I am new to this forum and a novice with Excel especially with respect
to creating fomulas.

Help !!

I have created a VLOOKUP table that has a value grid of 7 rows x 5
columns (apartment codes x different rates depending on length of
stay). Therefore depending on the apartment code the guest wants and
their length of stay there are 35 possible results.

Using this forum, I managed (somehow) to put together a few
concatenated IF statements to point to the correct cell in the VLOOKUP
table depending on apartment code and length of stay. I now realise
that I will have to do 35 concatenated IF statements and my head is
beginning to explode just doing two !

Is there a better way ? I know thereis a limitof 7nested IF statements
but is there a limit to thenumber of concatenated IF statements (if
that is a different thing) ?

Some examples of my bodged (but working) code is :-

=IF((AND(B310,B31<8,F21="KOC05")),VLOOKUP(F21,Pr ices!A3:C10,3,FALSE),IF((AND(B310,B31<8,F21="KOC0 3")),VLOOKUP(F21,Prices!A3:C10,3,FALSE),"Invali d
Input"))

p.s1
length of stays are daily, weekly, monthly, 3 monthly and 6 monthly.
ps2
administrator will just input apartment code and length of stay to
automatliccly pass rate to an invoice.


Assumptions:

1. Table is F1:K8
2. Lengths of stay -- G1:K8
3. Apartment code -- F2:F8
4. (Contents of F1 is irrelevant)

A1: Apt Code
A2: Length of Stay

Formula:

=VLOOKUP(A1,F1:K8,MATCH(A2,F1:K1,0),FALSE)

should give you the result you are looking for.

The MATCH function computes the proper column for the VLOOKUP function.


--ron
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Multiple IF statements or a better method ?

On Fri, 24 Nov 2006 19:33:48 -0500, Ron Rosenfeld
wrote:

On Fri, 24 Nov 2006 21:06:47 +0000, Bob Moore
wrote:


I am new to this forum and a novice with Excel especially with respect
to creating fomulas.

Help !!

I have created a VLOOKUP table that has a value grid of 7 rows x 5
columns (apartment codes x different rates depending on length of
stay). Therefore depending on the apartment code the guest wants and
their length of stay there are 35 possible results.

Using this forum, I managed (somehow) to put together a few
concatenated IF statements to point to the correct cell in the VLOOKUP
table depending on apartment code and length of stay. I now realise
that I will have to do 35 concatenated IF statements and my head is
beginning to explode just doing two !

Is there a better way ? I know thereis a limitof 7nested IF statements
but is there a limit to thenumber of concatenated IF statements (if
that is a different thing) ?

Some examples of my bodged (but working) code is :-

=IF((AND(B310,B31<8,F21="KOC05")),VLOOKUP(F21,P rices!A3:C10,3,FALSE),IF((AND(B310,B31<8,F21="KOC 03")),VLOOKUP(F21,Prices!A3:C10,3,FALSE),"Invali d
Input"))

p.s1
length of stays are daily, weekly, monthly, 3 monthly and 6 monthly.
ps2
administrator will just input apartment code and length of stay to
automatliccly pass rate to an invoice.


Assumptions:

1. Table is F1:K8
2. Lengths of stay -- G1:K8
3. Apartment code -- F2:F8
4. (Contents of F1 is irrelevant)

A1: Apt Code
A2: Length of Stay

Formula:

=VLOOKUP(A1,F1:K8,MATCH(A2,F1:K1,0),FALSE)

should give you the result you are looking for.

The MATCH function computes the proper column for the VLOOKUP function.


--ron


The above is incorrect:

Lengths of stay -- G1:K1


--ron
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using multiple IF statements Jshendel Excel Discussion (Misc queries) 8 August 29th 06 09:04 PM
Display multiple lines of text within a cell from multiple column. Zeeshan Zaheer Excel Worksheet Functions 3 August 23rd 06 10:08 AM
How can I have multiple "If" statements in one formula? MikeL Excel Discussion (Misc queries) 5 January 15th 06 03:36 AM
Is there an equation in Excel to use multiple if then statements? Cody5 Excel Discussion (Misc queries) 2 January 10th 06 09:02 PM
multiple IF statements Nathan McElmurry Excel Worksheet Functions 1 November 18th 04 09:22 PM


All times are GMT +1. The time now is 11:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"