Using if/then functions in Excel

G

Gary

I'm new to functions... How do I write the function "If cell D3 has any
character in it, then cell D4 = 1. If it has no characters, cell D4 = 0"

How about "If cell D3 has the word 'truck' in it, then cell D4 = 1"

Lastly, if I have a column of words such as car, truck, car, bus, bus, can
I somehow total the number of times "car" and "truck" appeared in the column?

Thanks,
Gary
 
M

Murthy

I'm new to functions... How do I write the function "If cell D3 has any
character in it, then cell D4 = 1. If it has no characters, cell D4 = 0"

Put this formula in D4
How about "If cell D3 has the word 'truck' in it, then cell D4 = 1"

Put this in D4
=if(D3="truck",1)
Lastly, if I have a column of words such as car, truck, car, bus, bus, can
I somehow total the number of times "car" and "truck" appeared in the column?

Look for COUNTIF in help. You should be able to do it..

- Murthy
 
S

Stefi

I'm new to functions... How do I write the function "If cell D3 has any
character in it, then cell D4 = 1. If it has no characters, cell D4 = 0"
Write in D4:
=IF(ISBLANK(D3),0,1)
How about "If cell D3 has the word 'truck' in it, then cell D4 = 1"
Write in D4:
=IF(D3="truck",1,"otherwise")

Lastly, if I have a column of words such as car, truck, car, bus, bus, can
I somehow total the number of times "car" and "truck" appeared in the column?

Write anywhere:
=COUNTIF(D:D,"car")

Regards,
Stefi
 

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

Top