amautaexcel
New Member
- Joined
- Jun 30, 2017
- Messages
- 7
Dear Excel Forum,
I am stumped by the following problem. I hope one of you can help me.
Goal: Create a sentence that lists items and it inserts the word "and" for the last entry.
I have a table where the user inputs the prices. If the price is included the items and the price is included in a sentence in a different sheet.
Apples . $5
Oranges $1
Pears $3
Bananas . $2
So for the table above, it would be: "Buy Apples $5, Oranges $1, Pears $3 and Bananas $2"
If the table only had apples and pears, it would be "Buy Apples $5 and Pears $3"
If the table only had pears and bananas it would be "Buy Pears $3 and Bananas $2"
I can string the text with if statements, but I have not been able to figure out how to tell it to include the "and" for the last entry.
Any thoughts?
I am stumped by the following problem. I hope one of you can help me.
Goal: Create a sentence that lists items and it inserts the word "and" for the last entry.
I have a table where the user inputs the prices. If the price is included the items and the price is included in a sentence in a different sheet.
Apples . $5
Oranges $1
Pears $3
Bananas . $2
So for the table above, it would be: "Buy Apples $5, Oranges $1, Pears $3 and Bananas $2"
If the table only had apples and pears, it would be "Buy Apples $5 and Pears $3"
If the table only had pears and bananas it would be "Buy Pears $3 and Bananas $2"
I can string the text with if statements, but I have not been able to figure out how to tell it to include the "and" for the last entry.
Any thoughts?