Combining different data fields into one column

Solved
1276 9
cancel
Showing results for
Did you mean:
4 - Data Explorer

Hi there,

I want to have a column which displays two bits of data. Those are a cumulative \$ amount and below that a cumulative % amount. I have these two lookup fields separately however need to combine them into one field column. Any help would be greatly appreciated,

Bart

1 Solution

Accepted Solutions
11 - Venus

for example like this

``````IF(
{Rollup profit (\$)},
"\$" & {Rollup profit (\$)}
)
&
IF(
AND({Rollup profit (\$)},{Rollup profit (%)}),
", "
)
&
IF(
{Rollup profit (%)},
INT({Rollup profit (%)}*100) & "%"
)``````
9 Replies 9
11 - Venus

Hi @bartdubs,

Two fields can be displayed as one by using the "&" operator symbol in the Formula field.

``````Name & " - " & Age
=> Jane - 28

"\""&{Product Name}&"\""
=> "GreatProduct"

Name & " \n" & Age
=> Jane
28``````

Formula Field Reference - Overview | Airtable Support

4 - Data Explorer

Hi @Sho

Thanks that makes sense. However, when I do that it inserts both values as basic numeric values. How would I be able to do it where it keeps the percentage as a percentage and the \$ value as a \$ value?

Thanks,

Bart

11 - Venus

If you want to display percentages or amounts as strings in the Formula field, you must also write such formatting yourself.

``````"\$" & {Value}

INT({Value}*100) & "%"``````

4 - Data Explorer

@Sho When using the formula

"\$" & {Rollup profit (\$)}, INT({Rollup profit (%)}*100) & "%"

It is just saying invalid formula. Is there any specific reason this might be?
(The fields labeled as rollup are both lookup fields)
11 - Venus

A little more!
"," is also a string.

``"\$" & {Rollup profit (\$)} & ", " & INT({Rollup profit (%)}*100) & "%"``

4 - Data Explorer

That's a lot better thank you very much

Last bit.....Is there a way to remove the excess symbols?

11 - Venus

for example like this

``````IF(
{Rollup profit (\$)},
"\$" & {Rollup profit (\$)}
)
&
IF(
AND({Rollup profit (\$)},{Rollup profit (%)}),
", "
)
&
IF(
{Rollup profit (%)},
INT({Rollup profit (%)}*100) & "%"
)``````
12 - Earth

If you mean floating point issue when displaying currency value, use ROUND({Rollup profit (\$)}, 2) , for example, to preserve 2 digits after comma.

4 - Data Explorer

thank you very much!!