Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

=if( ?? ) problem? 1

Status
Not open for further replies.

FYRGUY

Technical User
Nov 27, 2005
42
US
Greetings-
I have an excel spreadsheet that I have been working on.

The formula that I am using in cell P3 is =if(A8=32,D8,"")

This works great if only the number "32" is in cell A8. I need it to do the same calculation if there are other numbers with the 32 in that cell.

Example: 32,10 or 10,32 etc..

I have tried using "*32*" in the formula, but then it doesn't calculate if only the "36" is in the cell.

The A8 cell is where I keep track of basicly time codes. 10 is on duty, 32 is sick time, and there are other numbers used together, but probably not more than 2 or 3 numbers.

I hope I have explained this so it makes sense.

I need some help on the correct formula to this.

Thank you
Chris

 
If I understand the question, this will work:

=IF(ISERROR(SEARCH(32,A1)),"",$D$8)

 
Actually, according to your sample:
=IF(ISERROR(SEARCH(32,A8)),"",D8)

 
Lilliabeth,

That worked!!!! Thank you. Now can you please explain the ISERROR and SEARCH ? I do not undestand HOW that worked and I would like to know?

Thank you so much for the fast reply on my first question.

Chris
 
SEARCH looks for text in a string and returns the starting position of the text if it finds it. It returns an error if it doesn't find it. The FIND function would also have worked.

ISERROR returns TRUE if the arguments would result in an error and FALSE if the arguments would not result in an error.

 
Lilliabeth,

Thank you for the explination!

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top