![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Macon, Georgia USA
Posts: 124
|
I need this formula shorter and simpler.
=if(c6=11,"",if(c6=0,"",vlookup(c6,dutycode!$a$4:$d$14,4,))) column/row c6 has the code 11, but if a "0" is put in place of 11, "#N/A" will appear. So I added, if c6=0,"" will make "#N/A" disappear. Is there an easier way if c6 is blank or a "0" is place in c6. I saw a posting someplace like =if(a1=11,a1=0,e4) I think it is an IF(or( type statement. |
|
|
|
|
|
#2 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi
Don't confuse shorter with better or more effiecient, often not the case. But here are 2 more options. =IF(OR(C6=11,C6=0),"",VLOOKUP(C6,dutycode!$A$4:$D$14,4,)) =IF(COUNTIF(dutycode!$A$4:$A$14,C6)=0,"",VLOOKUP(C6,dutycode!$A$4:$D$14,4)) I alos note you haven't used False as the Range_lookup argument, you may want to change that? |
|
|
|
|
|
#3 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi
Don't confuse shorter with better or more effiecient, often not the case. But here are 2 more options. =IF(OR(C6=11,C6=0),"",VLOOKUP(C6,dutycode!$A$4:$D$14,4,)) =IF(COUNTIF(dutycode!$A$4:$A$14,C6)=0,"",VLOOKUP(C6,dutycode!$A$4:$D$14,4)) I also note you haven't used False as the Range_lookup argument, you may want to change that? |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|