# Excel IF statement for more than 7

1. ## Excel IF statement for more than 7

Hello again..

In my spreadsheet, I need to enter the formula for D5 as below :

=IF(D1=U8,(T8),IF(D1=U9,(T9),IF(D1=U10,(T10),IF(D1=U11,(T11),IF(D1=U12,(T12),IF(D1=U13,(T13),IF(D1=U14,(T14),IF(D1=U15,(T15),IF(D1=U16,(T16),IF(D1=U17,(T16),IF(D1=U18,(T18),IF(D1=U19,(T19)))))))))))))

but it seems that excel cannot accept more than 7 IF statements. Someone could help me ?

2. ## Re: Excel IF statement for more than 7

Try:

=Index(T8:T19,Match(D1,U8:U19,0))

3. ## Re: Excel IF statement for more than 7

Try this:

=LOOKUP(D1;U8:U19;T8:T19)

4. ## Re: Excel IF statement for more than 7

Also try the forum's search function.....

5. ## Re: Excel IF statement for more than 7

Originally Posted by zbor
Try this:

=LOOKUP(D1;U8:U19;T8:T19)
Only works only if U8:U19 is in alphabetic or numeric ascending order.

6. ## Re: Excel IF statement for more than 7

oh, yes, true...
I was lazy for writting example so I pull down from 1 to n and it worked

Index is good approach.

7. ## Re: Excel IF statement for more than 7

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@ THANKS A LOT @@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Thanks NBVC, its working. But sorry Zbor, your suggestion is not working, giving error message. But thanks for helping me..

8. ## Re: Excel IF statement for more than 7

How to mark a thread Solved
Go to the first post
Click edit
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1