Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Jasmine
 
Posts: n/a
Default If Statement Using Wild Cards

I am trying to write an If statement that uses wild cards, but it is not
working. My formula looks like =IF(A6="109*",85,IF(A6="110*",75,0)). A6 could
have a value of 109: Consumer Construction 1-4 Family Residential and I don't
want to have to type out the whole value. Is there a way to do this? Thanks!
  #2   Report Post  
Adrian M
 
Posts: n/a
Default

An alternate would be to set up another column which takes the first three
characters out of your A column (assuming the code you want is always the 1st
3 characters). You can do this by using the LEFT command ( see
http://www.auditexcel.co.za/text.html to see how to use it).

Now you can write a normal IF formula and for that matter sort or filter on
the new column. That way it is also easier to see what is happening in the
spreadsheet instead of having increasingly complex formula in one cell.

Hope this is what you were looking for.

"Jasmine" wrote:

I am trying to write an If statement that uses wild cards, but it is not
working. My formula looks like =IF(A6="109*",85,IF(A6="110*",75,0)). A6 could
have a value of 109: Consumer Construction 1-4 Family Residential and I don't
want to have to type out the whole value. Is there a way to do this? Thanks!

  #3   Report Post  
Gary's Student
 
Posts: n/a
Default

Change A6="109*"
to
LEFT(A6,3)="109"

Change A6="110*"
to
LEFT(A6,3)="110"


Good Luck
--
Gary's Student


"Jasmine" wrote:

I am trying to write an If statement that uses wild cards, but it is not
working. My formula looks like =IF(A6="109*",85,IF(A6="110*",75,0)). A6 could
have a value of 109: Consumer Construction 1-4 Family Residential and I don't
want to have to type out the whole value. Is there a way to do this? Thanks!

  #4   Report Post  
Bob Umlas
 
Posts: n/a
Default

Try:
=IF(LEFT(A9,3)="109",85,IF(LEFT(A6,3)="110",75,0))

"Jasmine" wrote in message
...
I am trying to write an If statement that uses wild cards, but it is not
working. My formula looks like =IF(A6="109*",85,IF(A6="110*",75,0)). A6

could
have a value of 109: Consumer Construction 1-4 Family Residential and I

don't
want to have to type out the whole value. Is there a way to do this?

Thanks!


  #5   Report Post  
Paul Sheppard
 
Posts: n/a
Default


Jasmine Wrote:
I am trying to write an If statement that uses wild cards, but it is
not
working. My formula looks like =IF(A6="109*",85,IF(A6="110*",75,0)). A6
could
have a value of 109: Consumer Construction 1-4 Family Residential and I
don't
want to have to type out the whole value. Is there a way to do this?
Thanks!



Hi Jasmine

Don't know about wildcards, but this would work

=IF(LEFT(A6,3)="109","85",IF(LEFT(A6,3)="110","75" ,0))


--
Paul Sheppard


------------------------------------------------------------------------
Paul Sheppard's Profile: http://www.excelforum.com/member.php...o&userid=24783
View this thread: http://www.excelforum.com/showthread...hreadid=397813



  #6   Report Post  
Stefi
 
Posts: n/a
Default

Hi Jasmine,

Try this UDF if you really need wildcards because of undefined length of
cell values:

Public Function wcif(s1 As String, s2 As String) As Boolean
wcif = (s1 Like s2 & "*")
End Function

Apply like
=IF(WCIF(A6,"109"),85,IF(WCIF(A6,"110"),75,0))

Regards,
Stefi

€˛Jasmine€¯ ezt Ć*rta:

I am trying to write an If statement that uses wild cards, but it is not
working. My formula looks like =IF(A6="109*",85,IF(A6="110*",75,0)). A6 could
have a value of 109: Consumer Construction 1-4 Family Residential and I don't
want to have to type out the whole value. Is there a way to do this? Thanks!

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
wild cards in formulas and functions Carla at work Excel Worksheet Functions 9 August 19th 05 07:18 PM
How do I use wild cards in nested array formulas? hopeit Excel Worksheet Functions 7 August 16th 05 02:18 AM
Wild Cards With Arrays Brian Excel Discussion (Misc queries) 4 July 7th 05 10:32 PM
Do I need a sumif or sum of a vlookup formula? PeterB Excel Worksheet Functions 0 June 1st 05 12:23 PM
Wild Cards in Find and Replace Jason Graf Excel Discussion (Misc queries) 1 February 1st 05 02:16 PM


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