ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Cell Date / Currency Convert (https://www.excelbanter.com/excel-discussion-misc-queries/57530-cell-date-currency-convert.html)

sparx

Cell Date / Currency Convert
 

Hello All, I have a worksheet that in one cell I want either a price or
date shown - at present I have a formula that looks within a
spreadsheet 2 from either 2 columns - one column is a date formatted
and the other column is price formatted - is there a way to have a
formula that will change its view automatically to either price or date
depending upon which column it looks at.


--
sparx
------------------------------------------------------------------------
sparx's Profile: http://www.excelforum.com/member.php...o&userid=16787
View this thread: http://www.excelforum.com/showthread...hreadid=488676


JE McGimpsey

Cell Date / Currency Convert
 
How should the formula decide which column to look at? Should it look at
any particular place within the column?

Perhaps this may give an idea.

Assume that the dates are in sheet2!A:A and the prices in sheet2!B:B.
Further assume that Sheet1!A1 will be either 0 or 1. If it's 0, then the
formula in A2 should return the date from the same row as the calling
cell, if it's 1, the A2 should return the price.

Then

=IF(A1=0,TEXT(Sheet2!A1,"dd mmmm yyyy"), TEXT(Sheet2!B1,"$#,##0.00"))

or, equivalently

=OFFSET(Sheet2!$A$1,ROW()-1,A1)




In article ,
sparx wrote:

Hello All, I have a worksheet that in one cell I want either a price or
date shown - at present I have a formula that looks within a
spreadsheet 2 from either 2 columns - one column is a date formatted
and the other column is price formatted - is there a way to have a
formula that will change its view automatically to either price or date
depending upon which column it looks at.


sparx

Cell Date / Currency Convert
 

Thanks for your help - it works fine - I will use this for certain.


--
sparx
------------------------------------------------------------------------
sparx's Profile: http://www.excelforum.com/member.php...o&userid=16787
View this thread: http://www.excelforum.com/showthread...hreadid=488676



All times are GMT +1. The time now is 04:21 AM.

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