look to see if data is in 2 or more cells out of three

Joe Eaton

New Member
Joined
Oct 15, 2024
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I have 3 cells which will have a number in (cost) one is GBP, the next is US Dollars and the third will be Euro
This is so i can do a calc to convert to GBP
But i am looking for a formula to show an error message like "Only put a cost in one cell"
I can do this over 2 cells with a formula but can't work out how to do so over three (and maybe 4 in the future)
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi,

maybe something like this can help :

Book1
ABCDEF
1X-Rate
21GBPConversion:3.32
30.76Dollar
40.83Euro4
Sheet1
Cell Formulas
RangeFormula
F2F2=IF(COUNTIF(C2:C4,">0")>1,"Only put cost in one cell",SUMPRODUCT(A2:A4,C2:C4))
 
Upvote 0
how about
data validation - and use
=COUNTA($A1:$D1)=1

where $A1:$D1 is the range of cells
 
Upvote 0
I have 3 cells which will have a number in (cost) one is GBP, the next is US Dollars and the third will be Euro
This is so i can do a calc to convert to GBP
But i am looking for a formula to show an error message like "Only put a cost in one cell"
I can do this over 2 cells with a formula but can't work out how to do so over three (and maybe 4 in the future)
COUNTA will count non blank cells.

VBA to extract info from one tab in several workbooks.xlsm
BCDEFGH
1
212
3Only put a cost in one cell.
433
5
6
7
Sheet1
Cell Formulas
RangeFormula
E3E3=IF(COUNTA(C2:C4)>1,"Only put a cost in one cell.","")
 
Upvote 0
To be a little clearer, the user will only have a cost which will be either be in GBP US dollar or Euro. My formula is just to show if by error the user adds in a number in 2 or more cells.
 
Upvote 0
In this case I think @HighAndWilder (or @etaf has provided what you need.

If you want to integrate that into your conversion formula, then you can use mine above.

thanks for the feedback.

cheers
Rob
 
Upvote 0
COUNTA will count non blank cells.

VBA to extract info from one tab in several workbooks.xlsm
BCDEFGH
1
212
3Only put a cost in one cell.
433
5
6
7
Sheet1
Cell Formulas
RangeFormula
E3E3=IF(COUNTA(C2:C4)>1,"Only put a cost in one cell.","")
This is perfect thank you.
COUNTA will count non blank cells.

VBA to extract info from one tab in several workbooks.xlsm
BCDEFGH
1
212
3Only put a cost in one cell.
433
5
6
7
Sheet1
Cell Formulas
RangeFormula
E3E3=IF(COUNTA(C2:C4)>1,"Only put a cost in one cell.","")
how about
data validation - and use
=COUNTA($A1:$D1)=1

where $A1:$D1 is the range of cell
 
Upvote 0
how about
data validation - and use
=COUNTA($A1:$D1)=1

where $A1:$D1 is the range of cells
Hi yes this does work but for my brain i can adapt HighandWilders easier for me to add the exchange rates. thanks any way
 
Upvote 0
datavalidation will work and only allow 1 value to be entered and bring up and error message - which you can custom to add an input message - so you can have a note appears as to what to do and also an error message if they try to put a 2nd value in
and STOPS 2 or more values and people just ignoring the message
Hi yes this does work but for my brain i can adapt HighandWilders easier for me to add the exchange rates. thanks any way
if you do need to go that way - maybe ADD conditional formatting to colour the cells to make it very clear
 
Upvote 0

Forum statistics

Threads
1,223,840
Messages
6,174,956
Members
452,593
Latest member
Jason5710

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