How to return just the cell that contain a text ?

Inacio11

New Member
Joined
Jul 3, 2018
Messages
34
Supose the following sheet:
Column AColumn BColumn CColumn DColumn E
Saldo---Saldo
-Transferencia--Transferencia
---GastosGastos
--Credito-Credito

<tbody>
</tbody>
Which formula to use to get on column "E" just the final text (different from "-")

Thanks in advance !
Inacio
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
If they're actually dashes:


Excel 2010
ABCDE
1Column AColumn BColumn CColumn DColumn E
2Saldo---Saldo
3-Transferencia--Transferencia
4---GastosGastos
5--Credito-Credito
Sheet3
Cell Formulas
RangeFormula
E2{=INDEX($A2:$D2,MATCH(TRUE,$A2:$D2<>"-",0))}
Press CTRL+SHIFT+ENTER to enter array formulas.


LOOKUP("z",IF(A2:D2="-",0,A2:D2)) ctrl-shift-enter works too

If zeroes:


Excel 2010
ABCDE
1Column AColumn BColumn CColumn DColumn E
2Saldo000Saldo
30Transferencia00Transferencia
4000GastosGastos
500Credito0Credito
Sheet3
Cell Formulas
RangeFormula
E2=LOOKUP("z",A2:D2)
 
Last edited:
Upvote 0

Book1
ABCDE
2Saldo---Saldo
3-Transferencia--Transferencia
4---GastosGastos
5--Credito-Credito
Sheet1


In E2 enter and copy down:

=LOOKUP(9.99999999999999E+307,1/($A2:$D2<>"-"),$A2:$D2)
 
Upvote 0
Hi,

If using last formula from Post #2 , I'd suggest this modification:


Book1
ABCDEF
1Column AColumn BColumn CColumn DColumn E
20Zebra00Zebra#N/A
30Transferencia00TransferenciaTransferencia
4000GastosGastosGastos
500Credito0CreditoCredito
6
7ModifiedFrom Post #2
Sheet119
Cell Formulas
RangeFormula
E2=LOOKUP(REPT("z",255),A2:D2)
F2=LOOKUP("z",A2:D2)
 
Last edited:
Upvote 0
Hello again,
After some time running with the formula "LOOKUP(9.99999999999999E+307,1/($A2:$D2<>"-"),$A2:$D2)" I realized some results errors. The contents from range A~D comes from other formulas (when I copy and paste the contents range as values the results becomes correct). I suppose the data from range A~D (built by formulas) is affecting the results.
Any idea how to solve it ?
Thanks in advance
 
Upvote 0
Hello again,
After some time running with the formula "LOOKUP(9.99999999999999E+307,1/($A2:$D2<>"-"),$A2:$D2)" I realized some results errors. The contents from range A~D comes from other formulas (when I copy and paste the contents range as values the results becomes correct). I suppose the data from range A~D (built by formulas) is affecting the results.
Any idea how to solve it ?
Thanks in advance

What are the incorrect results that you get?
 
Upvote 0
Hard to explain with no visualization of the sheet....but for example if I type any word in any cell....the results changes (does not make sense ???).
Suppose that I found a solution using the formula "{=INDEX($A2:$D2,MATCH(TRUE,$A2:$D2<>"-",0))}" posted by sheetspread.....no errors till now !
Thanks
 
Upvote 0
Hard to explain with no visualization of the sheet....but for example if I type any word in any cell....the results changes (does not make sense ???).
Suppose that I found a solution using the formula "{=INDEX($A2:$D2,MATCH(TRUE,$A2:$D2<>"-",0))}" posted by sheetspread.....no errors till now !
Thanks


{=INDEX($A2:$D2,MATCH(TRUE,$A2:$D2<>"-",0))}

returns the first value which is not "-".

=LOOKUP(9.99999999999999E+307,1/($A2:$D2<>"-"),$A2:$D2)

returns the last value which is not "-".


You must try to explicit what you result you get instead of the result that you expect.
 
Upvote 0

Forum statistics

Threads
1,215,746
Messages
6,126,647
Members
449,325
Latest member
Hardey6ix

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top