Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Kevin
 
Posts: n/a
Default Shorten a Formula

I have a formula that is pretty long. It works, but I have to propagate it
into 500+ other cells and the editing will take a long time.

Anyway, please take a look and see if there is any way I can shorten this
up. I'm sure there is, but I'm at my limits.

=IF(ISNA(IF(ISNA(VLOOKUP(A6,A99:A168,1,FALSE)=A6), (0+VLOOKUP(A6,G99:H168,2,FALSE)),IF(ISNA(VLOOKUP(A 6,G99:G168,1,FALSE)=A6),(0+VLOOKUP(A6,A99:B168,2,F ALSE)),VLOOKUP(A6,A99:B168,2,FALSE)+VLOOKUP(A6,G99 :H168,2,FALSE)))),0,IF(ISNA(VLOOKUP(A6,A99:A168,1, FALSE)=A6),(0+VLOOKUP(A6,G99:H168,2,FALSE)),IF(ISN A(VLOOKUP(A6,G99:G168,1,FALSE)=A6),(0+VLOOKUP(A6,A 99:B168,2,FALSE)),VLOOKUP(A6,A99:B168,2,FALSE)+VLO OKUP(A6,G99:H168,2,FALSE))))

Thanks,

Kevin
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bpeltzer
 
Posts: n/a
Default Shorten a Formula

Could you tell us what this is supposed to do? It's riddled with
redundancy!! As for the difficulty of copying it, I wonder if the challenge
is just because the tables used in the vlookup use relative references. That
is, if you make the vlookup something like vlookup(a6,$a$99:$a$168,1,false)
instead of vlookup(a6,a99,b168,1,false), then when you copy the formula, the
table reference will remain constant ('absolute').
--Bruce

"Kevin" wrote:

I have a formula that is pretty long. It works, but I have to propagate it
into 500+ other cells and the editing will take a long time.

Anyway, please take a look and see if there is any way I can shorten this
up. I'm sure there is, but I'm at my limits.

=IF(ISNA(IF(ISNA(VLOOKUP(A6,A99:A168,1,FALSE)=A6), (0+VLOOKUP(A6,G99:H168,2,FALSE)),IF(ISNA(VLOOKUP(A 6,G99:G168,1,FALSE)=A6),(0+VLOOKUP(A6,A99:B168,2,F ALSE)),VLOOKUP(A6,A99:B168,2,FALSE)+VLOOKUP(A6,G99 :H168,2,FALSE)))),0,IF(ISNA(VLOOKUP(A6,A99:A168,1, FALSE)=A6),(0+VLOOKUP(A6,G99:H168,2,FALSE)),IF(ISN A(VLOOKUP(A6,G99:G168,1,FALSE)=A6),(0+VLOOKUP(A6,A 99:B168,2,FALSE)),VLOOKUP(A6,A99:B168,2,FALSE)+VLO OKUP(A6,G99:H168,2,FALSE))))

Thanks,

Kevin

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Kevin
 
Posts: n/a
Default Shorten a Formula

I know it's a horrible thing to look at, but I don't have much (if any)
experience with formulas, so it's what I got to work.

It's supposed to take an exact match from A6, compare it to the Vlookup. If
it's there, look in the other Vlookup for A6. If A6 is in the second Vlookup,
add the two values in the 2nd column of the Vlookup's together and drop in
the cell. If A6 results in N/A, it should assign a zero for the N/A in
either lookup when adding them together.

Sometimes A6 will exist in both lookups, sometimes only in one, and
sometimes never. I have to at least have a result of 0 in the final result,
and never an N/A, for my import into another database from the spreadsheet to
work.

Thank you for the "absolute" information. That saved me a ton of time
copying the formula. I would like to make it a bit more logical, so if you
have any advice it would be appreciated.

Again, thanks for the help.

Kevin

"bpeltzer" wrote:

Could you tell us what this is supposed to do? It's riddled with
redundancy!! As for the difficulty of copying it, I wonder if the challenge
is just because the tables used in the vlookup use relative references. That
is, if you make the vlookup something like vlookup(a6,$a$99:$a$168,1,false)
instead of vlookup(a6,a99,b168,1,false), then when you copy the formula, the
table reference will remain constant ('absolute').
--Bruce

"Kevin" wrote:

I have a formula that is pretty long. It works, but I have to propagate it
into 500+ other cells and the editing will take a long time.

Anyway, please take a look and see if there is any way I can shorten this
up. I'm sure there is, but I'm at my limits.

=IF(ISNA(IF(ISNA(VLOOKUP(A6,A99:A168,1,FALSE)=A6), (0+VLOOKUP(A6,G99:H168,2,FALSE)),IF(ISNA(VLOOKUP(A 6,G99:G168,1,FALSE)=A6),(0+VLOOKUP(A6,A99:B168,2,F ALSE)),VLOOKUP(A6,A99:B168,2,FALSE)+VLOOKUP(A6,G99 :H168,2,FALSE)))),0,IF(ISNA(VLOOKUP(A6,A99:A168,1, FALSE)=A6),(0+VLOOKUP(A6,G99:H168,2,FALSE)),IF(ISN A(VLOOKUP(A6,G99:G168,1,FALSE)=A6),(0+VLOOKUP(A6,A 99:B168,2,FALSE)),VLOOKUP(A6,A99:B168,2,FALSE)+VLO OKUP(A6,G99:H168,2,FALSE))))

Thanks,

Kevin

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
daddylonglegs
 
Posts: n/a
Default Shorten a Formula


You should only need this

=IF(ISNA(MATCH(A6,A99:A168,0)),0,VLOOKUP(A6,A99:B1 68,2,0))+IF(ISNA(MATCH(A6,G99:G168,0)),0,VLOOKUP(A 6,G99:H168,2,0))


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=505501

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Kevin
 
Posts: n/a
Default Shorten a Formula

Thanks, it works great.

Kevin

"daddylonglegs" wrote:


You should only need this

=IF(ISNA(MATCH(A6,A99:A168,0)),0,VLOOKUP(A6,A99:B1 68,2,0))+IF(ISNA(MATCH(A6,G99:G168,0)),0,VLOOKUP(A 6,G99:H168,2,0))


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=505501


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
Is it possible? DakotaNJ Excel Worksheet Functions 25 September 18th 06 09:30 PM
Shorten an IF formula Joker Excel Discussion (Misc queries) 4 December 10th 05 12:30 PM
Creating a check mark box MarthaSue Setting up and Configuration of Excel 18 April 28th 05 12:31 AM
Match / Vlookup within an Array formula Hari Prasadh Excel Discussion (Misc queries) 3 February 3rd 05 04:37 PM
Shorten sumproduct formula Andre Croteau Excel Discussion (Misc queries) 1 December 11th 04 10:30 PM


All times are GMT +1. The time now is 12:45 PM.

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

About Us

"It's about Microsoft Excel"