Excel wizards...
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

[Closed] Excel wizards...

8 Posts
5 Users
0 Reactions
117 Views
Posts: 1736
Free Member
Topic starter
 

Struggling with an "IF" formula... Simple spreadsheet to calculate some selling rates. If the individual is "staff" then we use their salary * formula a. If they are "contractor" then we use salary * formula b.

Can i select which formula to use based on whether a cell contains the text "staff" or "contractor"?

i.e.
IF cell contains "contractor" then multiply by x; IF cell contains "staff" multiply by y

Ta!!


 
Posted : 14/11/2012 12:23 pm
Posts: 0
Full Member
 

Yes

Edit: Use the [i]search[/i] function - http://office.microsoft.com/en-gb/excel-help/search-searchb-HP005209249.aspx?CTT=5&origin=HP005203209


 
Posted : 14/11/2012 12:24 pm
Posts: 79
Free Member
 

if(isnumber(find(<cell>,"Staff")),<salary>*<y>,<salary>*<x>)))

Replacing the <> references with whatever cells you're looking at. Although as above, use Search if your data isn't in a particular case.


 
Posted : 14/11/2012 12:29 pm
 IHN
Posts: 19694
Full Member
 

IF(cellref="Staff",salary*y,IF(cellref="Contractor",salary*x,"Error Message as they're not staff or contractor")


 
Posted : 14/11/2012 12:33 pm
Posts: 0
Free Member
 

SEARCH seems complicated. Its just a standard IF function.

If the only two options for the type are "staff" or "contractor" then just us a single IF. If there are other otions you want to ignore the use 2 IFs.

e.g. if A2 contains the type of person and B2 contains the sallary then type.

=IF(A2="Staff",B2*[i]y[/i],B2*[i]x[/i])

of

=IF(A2="Staff",B2*[i]y[/i],IF(A2="Contractor",B2*[i]x[/i],NA()))


 
Posted : 14/11/2012 12:35 pm
Posts: 1736
Free Member
Topic starter
 

jfletch/IHN - ta - that's got it 😆


 
Posted : 14/11/2012 12:54 pm
Posts: 79
Free Member
 

jfletch - Member
SEARCH seems complicated. Its just a standard IF function.

I was working on the basis that the cell contained more than just Staff or Contractor, i.e. some other text elsewhere


 
Posted : 14/11/2012 1:32 pm
Posts: 0
Full Member
 

I was working on the basis that the cell contained more than just Staff or Contractor, i.e. some other text elsewhere

me too!


 
Posted : 14/11/2012 1:39 pm
Posts: 0
Free Member
 

I was working on the basis that the cell contained more than just Staff or Contractor, i.e. some other text elsewhere

me too!

Seems you were making the problem more compilicated than it needed to be! 😉


 
Posted : 14/11/2012 2:17 pm

6 DAYS LEFT
We are currently at 95% of our target!