ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Create a 'text' string based on whether values appear in other cel (https://www.excelbanter.com/excel-worksheet-functions/131412-create-text-string-based-whether-values-appear-other-cel.html)

Ben

Create a 'text' string based on whether values appear in other cel
 
Hello

Hope someone can help... I have a basic table:

Service Child Group Disc_card1 Disc_card2 SeniorCitizen
1 50% 10% 60% 30%
2 50% 15% 25% 90%

For each 'service' I may offer a discount to children, senior citizens or
those with discount cards.

I then want to create an adjacent cell, which populates a text field "There
is a 50% for children, 10% for Groups, No discounts for Disc_card1"

Is there a formula that will do an 'if' query to see if there is a value in
a cell, if there is turn that into a sentence and put it into a text table (I
guess I will need to use 'CONCATENATE' some where?)

Please help!!

Thanks


Harlan Grove

Create a 'text' string based on whether values appear in other cel
 
Ben wrote...
....
Service Child Group Disc_card1 Disc_card2 SeniorCitizen
1 50% 10% 60% 30%
2 50% 15% 25% 90%

....

If this table were in A1:F3,

I then want to create an adjacent cell, which populates a text field
"There is a 50% for children, 10% for Groups, No discounts for
Disc_card1"

....

then try this formula in cell G2.

="There is "&TEXT(B2,"[=0]\n\o;\a 0%")&" discount for children, "
&TEXT(C2,"[=0]\n\o;\a 0%")&" discount for groups, "
&TEXT(D2,"[=0]\n\o;\a 0%")&" discount for Disc_card1, "
&TEXT(E2,"[=0]\n\o;\a 0%")&" discount for Disc_card2, and "
&TEXT(F2,"[=0]\n\o;\a 0%")&" discount for senior citizens."

Fill G2 down into G3.


Bob Phillips

Create a 'text' string based on whether values appear in other cel
 
=IF(A2<"",TEXT(A2,"0%"),"No")&" discount for
children,"&IF(B2<"",TEXT(B2,"0%"),"No")&" discount for
groups,"&IF(C2<"",TEXT(C2,"0%"),"No")&" discount for Disc card
1,"&IF(D2<"",TEXT(D2,"0%"),"No")&" discount for Disc card 2"

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Ben" wrote in message
...
Hello

Hope someone can help... I have a basic table:

Service Child Group Disc_card1 Disc_card2 SeniorCitizen
1 50% 10% 60% 30%
2 50% 15% 25% 90%

For each 'service' I may offer a discount to children, senior citizens or
those with discount cards.

I then want to create an adjacent cell, which populates a text field
"There
is a 50% for children, 10% for Groups, No discounts for Disc_card1"

Is there a formula that will do an 'if' query to see if there is a value
in
a cell, if there is turn that into a sentence and put it into a text table
(I
guess I will need to use 'CONCATENATE' some where?)

Please help!!

Thanks




Ben

Create a 'text' string based on whether values appear in other
 
Harlan

Thank you very much for this!!!

May I quickly ask, how can I insert a 'carriage return' to make the next
discount go on the next line??

Thanks

Ben




"Harlan Grove" wrote:

Ben wrote...
....
Service Child Group Disc_card1 Disc_card2 SeniorCitizen
1 50% 10% 60% 30%
2 50% 15% 25% 90%

....

If this table were in A1:F3,

I then want to create an adjacent cell, which populates a text field
"There is a 50% for children, 10% for Groups, No discounts for
Disc_card1"

....

then try this formula in cell G2.

="There is "&TEXT(B2,"[=0]\n\o;\a 0%")&" discount for children, "
&TEXT(C2,"[=0]\n\o;\a 0%")&" discount for groups, "
&TEXT(D2,"[=0]\n\o;\a 0%")&" discount for Disc_card1, "
&TEXT(E2,"[=0]\n\o;\a 0%")&" discount for Disc_card2, and "
&TEXT(F2,"[=0]\n\o;\a 0%")&" discount for senior citizens."

Fill G2 down into G3.



Harlan Grove

Create a 'text' string based on whether values appear in other
 
Ben wrote...
....
May I quickly ask, how can I insert a 'carriage return' to make the
next discount go on the next line??

....

="... one discount"&CHAR(10)&"another discount ..."

but you need to set the cell to wrap, and you may have to increase
column widths.



All times are GMT +1. The time now is 06:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com