Formula to check A1 format (General or Date) then return B1 OR C1 depending on A1's formatting?

Event2020

Board Regular
Joined
Jan 6, 2011
Messages
122
Office Version
  1. 2019
Platform
  1. Windows
Can the following be done with a excel formula as I am unable to get it right?

I am using Excel 2007 on Windows.

If cell A1 is formatted as 'General' then return the contents of cell B1 but if A1 is formatted as a 'Date' then return the contents of cell C1.

I can find a lot of information on how to format a cell depending on what it contains (conditional formatting) but in my case the cell is already formatted (either General or Date) and I need the formula to return the contents of either Cell B1 or C1 depending on how A1 is formatted.

Many thanks.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Event2020, Good evening.

I'm not sure if the CELL function can help you.

Take a look at help of Excel for CELL --> format --> function.

But try to use:
Code:
=IF(CELL("format",A1)="G",B1,C1)

I hope it helps.
 
Upvote 0

Forum statistics

Threads
1,223,721
Messages
6,174,096
Members
452,542
Latest member
Bricklin

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