Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-17-2014, 04:53 PM
Jimmy Tsawo Jimmy Tsawo is offline Modelling and Formatting Windows Vista Modelling and Formatting Office 2010 64bit
Novice
Modelling and Formatting
 
Join Date: Feb 2014
Posts: 4
Jimmy Tsawo is on a distinguished road
Default Modelling and Formatting

I am currently undertaking an exercise at varsity. I have 3 columns, with base, target, and actual. these 3 columns can be in percentages, actual numbers, dates, or currency. For example, base is 1-Jan-2013; target is 31-Dec-2013. The actual date is 20-Dec-2013.



I would like the second and third columns to automatically change to the format of the first column, for example, if the first column is in percentage (%), the remaining two columns automatically change to percentage.

is there a way of creating an error message on the second and third column if they do not match the format of the first column?

Thank you in advance those who can assist.
Reply With Quote
  #2  
Old 02-17-2014, 08:46 PM
macropod's Avatar
macropod macropod is offline Modelling and Formatting Windows 7 32bit Modelling and Formatting Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

A formula cannot change a cell's format; it can only change the way data are displayed. And, although you could set up a complicated IF test containing the CELL("format",reference) function to test a cell's format, to obtain basic information such as date, percentage, currency, etc., it can only provide limited information about how many decimal places are displayed, whether thousands separators are used, how a date is formatted, etc.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 02-19-2014, 12:25 AM
Jimmy Tsawo Jimmy Tsawo is offline Modelling and Formatting Windows Vista Modelling and Formatting Office 2010 64bit
Novice
Modelling and Formatting
 
Join Date: Feb 2014
Posts: 4
Jimmy Tsawo is on a distinguished road
Default

I have used the following formula and it worked very well.

=AND(CELL("format",A1)=CELL("format",B1),CELL("for mat",A1)=CELL("format",C1))

My next question is as follows:
I want to add another column with a dropdown of the different units of measurement, eg %, dates, numbers, etc.

How can I use this formula to detect different formats in all the columns?
Reply With Quote
  #4  
Old 02-19-2014, 12:39 AM
macropod's Avatar
macropod macropod is offline Modelling and Formatting Windows 7 32bit Modelling and Formatting Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Your dropdown would need a lookup table with both the CELL format codes and their descriptions. Look up Excel's Help file for the CELL function to see what those are. I'm not sure how you'd plan to use the dropdown, though.

To return the codes for a positive match you could use:
=IF(AND(CELL("format",A1)=CELL("format",B1),CELL(" format",A1)=CELL("format",C1))=TRUE,CELL("format", A1),FALSE)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Other Forums: Access Forums

All times are GMT -7. The time now is 05:53 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft