Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Brian
 
Posts: n/a
Default Need to improve a formula

Hello,
I hope this request is not too wacky.
This f returns the contents of E20 (which in this case is "1750 - 0410")if
the look up finds a cell that starts with a number but if the look up finds a
cell that starts with a letter then it returns the content of the found cell.
Now I want to add to this, something that states if the lookup finds a cell
that has "Swch" in it then return the contents of that cell along with the
contents of E20

=IF(ISNUMBER(LEFT(VLOOKUP(E27,'[D Patrol Log Even.xls]Patrol
Log'!$C$22:$M$45,11,0))+0),$E$20,IF(ISTEXT(LEFT(VL OOKUP(E27,'[D Patrol Log
Even.xls]Patrol Log'!$C$22:$M$45,11,0))),VLOOKUP(E27,'[D Patrol Log
Even.xls]Patrol Log'!$C$22:$M$45,11,0),""))

Thank You
Brian


  #2   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
try:
=IF(ISNUMBER(LEFT(VLOOKUP(E27,'[D Patrol Log Even.xls]Patrol
Log'!$C$22:$M$45,11,0))+0),$E$20,IF(ISTEXT(LEFT(VL OOKUP(E27,'[D Patrol
Log
Even.xls]Patrol Log'!$C$22:$M$45,11,0))),VLOOKUP(E27,'[D Patrol Log
Even.xls]Patrol Log'!$C$22:$M$45,11,0) & "-" & $E$20,""))

You may also consider using a two cell approach as you have to
calculate the VLOOKUP function up to three times. So maybe put in your
first cell (e.g. X1):
X1:
VLOOKUP(E27,'[D Patrol Log Even.xls]Patrol Log'!$C$22:$M$45,11,0)
(you can hide this column if you want afterwards)

And in your target cell then use:
=IF(ISNUMBER(-LEFT(X1)),$E$20,IF(ISTEXT(LEFT(X1)),X1 & "-" & $E$20,""))

--
Regards
Frank Kabel
Frankfurt, Germany

"Brian" schrieb im Newsbeitrag
...
Hello,
I hope this request is not too wacky.
This f returns the contents of E20 (which in this case is "1750 -

0410")if
the look up finds a cell that starts with a number but if the look up

finds a
cell that starts with a letter then it returns the content of the

found cell.
Now I want to add to this, something that states if the lookup finds

a cell
that has "Swch" in it then return the contents of that cell along

with the
contents of E20

=IF(ISNUMBER(LEFT(VLOOKUP(E27,'[D Patrol Log Even.xls]Patrol
Log'!$C$22:$M$45,11,0))+0),$E$20,IF(ISTEXT(LEFT(VL OOKUP(E27,'[D

Patrol Log
Even.xls]Patrol Log'!$C$22:$M$45,11,0))),VLOOKUP(E27,'[D Patrol Log
Even.xls]Patrol Log'!$C$22:$M$45,11,0),""))

Thank You
Brian



  #3   Report Post  
Brian
 
Posts: n/a
Default

Thank You,
I would try it that way but I already have so many tables and other
reference cells, it looks like a jungle. I am afraid to add another thing for
fear of ruining the whole workbook.

Thanks again,
Brian

"Frank Kabel" wrote:

Hi
try:
=IF(ISNUMBER(LEFT(VLOOKUP(E27,'[D Patrol Log Even.xls]Patrol
Log'!$C$22:$M$45,11,0))+0),$E$20,IF(ISTEXT(LEFT(VL OOKUP(E27,'[D Patrol
Log
Even.xls]Patrol Log'!$C$22:$M$45,11,0))),VLOOKUP(E27,'[D Patrol Log
Even.xls]Patrol Log'!$C$22:$M$45,11,0) & "-" & $E$20,""))

You may also consider using a two cell approach as you have to
calculate the VLOOKUP function up to three times. So maybe put in your
first cell (e.g. X1):
X1:
VLOOKUP(E27,'[D Patrol Log Even.xls]Patrol Log'!$C$22:$M$45,11,0)
(you can hide this column if you want afterwards)

And in your target cell then use:
=IF(ISNUMBER(-LEFT(X1)),$E$20,IF(ISTEXT(LEFT(X1)),X1 & "-" & $E$20,""))

--
Regards
Frank Kabel
Frankfurt, Germany

"Brian" schrieb im Newsbeitrag
...
Hello,
I hope this request is not too wacky.
This f returns the contents of E20 (which in this case is "1750 -

0410")if
the look up finds a cell that starts with a number but if the look up

finds a
cell that starts with a letter then it returns the content of the

found cell.
Now I want to add to this, something that states if the lookup finds

a cell
that has "Swch" in it then return the contents of that cell along

with the
contents of E20

=IF(ISNUMBER(LEFT(VLOOKUP(E27,'[D Patrol Log Even.xls]Patrol
Log'!$C$22:$M$45,11,0))+0),$E$20,IF(ISTEXT(LEFT(VL OOKUP(E27,'[D

Patrol Log
Even.xls]Patrol Log'!$C$22:$M$45,11,0))),VLOOKUP(E27,'[D Patrol Log
Even.xls]Patrol Log'!$C$22:$M$45,11,0),""))

Thank You
Brian




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
revert formula insertion to old method Don't be a pain in the ass Setting up and Configuration of Excel 0 January 24th 05 01:49 PM
Simple formula doesn't quite add up circeo Excel Discussion (Misc queries) 3 January 17th 05 09:04 PM
how do I make a formula NOT change when the data range is moved? Alida Andrews Excel Discussion (Misc queries) 2 January 6th 05 09:02 PM
Cell doesn't show formula result - it shows formula (CTRL + ' doe. o0o0o0o Excel Worksheet Functions 6 November 19th 04 03:13 PM
Excel 2003 - Formula result shows as 0:00 Serena Excel Worksheet Functions 4 November 11th 04 10:18 PM


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