Using text as a criteria in Excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to get a value in excel where the criteria that has to be
satisfied are text in nature, but I do not what to type the text in the
formula but the cell reference.

I have use Sumif, If & And but no joy.

I hoping someone will be able to help.

Thanks
Tunde
 
Try this:

=IF(A1="some text",action_if_true,action_if_false)
or
=SUMIF(range_to_test,"some text",range_to_sum)

You must put quotes around the text.

Hope this helps.

Pete
 
Criteria to be entered into A1, can be text *OR* numeric:
If the formula is referencing a cell, *no* quotes are needed around the cell
reference.

=Sumif(B1:B100,A1,C1:C100)
As long as B1 to B100 are supposed to *match* the text in A1.

If B1 to B100 contains *only part* of the criteria (criteria="b" - AND -
B1:B100="abc", "bad", "cab", ... etc.), use this:

=SUMIF(B1:B100,"*"&A1&"*",C1:C100)
 
Pete,

Thanks for your response, it helped in solving the problem.

Tunde
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top