Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Complex IF THEN statement

Greg S <Greg wrote...
HI...I'm trying to figure out how to do a long IF THEN statement. *I have
three columns. *Column 1 is validated data with 20 possibilities. *Column two
is validated data with 15 possibilities. *I want the third column to
automatically fill in based on the values in columns 1 & 2. *

....

How would the 3rd column automatically fill in based on the 1st and
2nd columns? By looking up the 1st and 2nd column values in a 3-column
table elsewhere? By generating different labels in the 3rd column for
each distinct combination of entries in the 1st and 2nd columns?
Something else?

How were the Restaurant # entries in the 3rd column of your sample
table determined? Were they just more entries along with the 1st and
2nd columns? If so, it'd seem you want to perform table lookups. If
your source table were named TBL and you the 1st and 2nd column values
you wanted to look up were in cells C5 and D5, you could use an array
formula like

=INDEX(SRC,MATCH(1,(INDEX(SRC,0,1)=C5)*(INDEX(SRC, 0,2)=D5),0),3)

On the other hand, if you wanted to generate unique labels consisiting
of the word Restaurant followed by a space followed by a different
number for each combination of entries in the 1st and 2nd columns, and
if the top-left cell of the table were A1, you could use formulas like

C1:
Restaurant 1

C2:
=IF(COUNT(MATCH(1,COUNTIF(A2,A$1:A1)*COUNTIF(B2,B$ 1:B1),0)),
INDEX(C$1:C1,MATCH(1,COUNTIF(A2,A$1:A1)*COUNTIF(B2 ,B$1:B1),0)),
"Restaurant "&(MAX(--SUBSTITUTE(C$1:C1,"Restaurant ",""))+1))

Fill C2 down in column C as far as needed.
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
Complex If/And Statement jonssmaster Excel Worksheet Functions 8 December 1st 08 07:27 PM
Complex IF STATEMENT CR3 Excel Discussion (Misc queries) 3 December 6th 07 12:32 PM
Help with complex If statement GHawkins[_2_] Excel Worksheet Functions 2 September 6th 07 10:16 PM
Another Extremely complex IF statement Teri Excel Worksheet Functions 2 January 29th 07 08:27 PM
complex IF(OR(...AND())) statement Dave F Excel Discussion (Misc queries) 2 October 4th 06 06:24 PM


All times are GMT +1. The time now is 03:58 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"