Using text as a criteria in Excel

B

Baba

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
 
P

Pete_UK

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
 
R

Ragdyer

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)
 
Top