Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Robbie in Houston
 
Posts: n/a
Default =IF logical test to search only part of a cell

I am trying to get the =IF function to test only part of a cell as the
logical test. I am trying to create an Invoice template for online sales.
I will only be charging sales tax for Texas residents. I need the tax
formula to only calculate tax if the state is Texas. I do not want to
separate the City, State and Zip as they are currently a single cell. For
instance,

F4 Houston, Texas 77003
F27 =SUM(F18:F26)
F28 8.25 [Format-Percentage]
F29 =F27*F28

For F29, I have tried =IF(F4="*Texas*", F27*F28, 0) but got no results. Can
I make the formula work to look for Texas only? Or is there a better way to
go about this?


  #2   Report Post  
CLR
 
Posts: n/a
Default

If the format of F4 will always be, "CityName, Texas Zipcode",
then.........this formula should work in F29.

=IF(MID(F4,FIND(",",F4,1)+2,5)="Texas",F27*F28,0)

Vaya con Dios,
Chuck, CABGx3


"Robbie in Houston" wrote in message
...
I am trying to get the =IF function to test only part of a cell as the
logical test. I am trying to create an Invoice template for online sales.
I will only be charging sales tax for Texas residents. I need the tax
formula to only calculate tax if the state is Texas. I do not want to
separate the City, State and Zip as they are currently a single cell. For
instance,

F4 Houston, Texas 77003
F27 =SUM(F18:F26)
F28 8.25 [Format-Percentage]
F29 =F27*F28

For F29, I have tried =IF(F4="*Texas*", F27*F28, 0) but got no results.

Can
I make the formula work to look for Texas only? Or is there a better way

to
go about this?




  #3   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Another method that's a little more robust:

=IF(ISNUMBER(SEARCH("texas",F4)),F27*F28,0)

Biff

-----Original Message-----
I am trying to get the =IF function to test only part of

a cell as the
logical test. I am trying to create an Invoice template

for online sales.
I will only be charging sales tax for Texas residents. I

need the tax
formula to only calculate tax if the state is Texas. I

do not want to
separate the City, State and Zip as they are currently a

single cell. For
instance,

F4 Houston, Texas 77003
F27 =SUM(F18:F26)
F28 8.25 [Format-Percentage]
F29 =F27*F28

For F29, I have tried =IF(F4="*Texas*", F27*F28, 0) but

got no results. Can
I make the formula work to look for Texas only? Or is

there a better way to
go about this?


.

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
Can you make a cell with a diagonal, so that you can edit the upper and lower part of the cell? g wills New Users to Excel 3 February 17th 05 11:23 PM
How do I test a cell for part of text East London Excel Worksheet Functions 1 January 26th 05 12:36 PM
vlookup to extract part cell content excelFan Excel Discussion (Misc queries) 2 December 5th 04 09:45 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 08:16 PM
logical test - within a range esslingerdav Excel Worksheet Functions 4 November 17th 04 04:13 PM


All times are GMT +1. The time now is 09:48 AM.

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"